diff --git a/README.md b/README.md index e966d0db..e7e9bf62 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ You can enter the example for information about "How to run" - [bizdemo/hertz_gorm_gen:](bizdemo/hertz_gorm_gen) Example of using gorm/gen & proto IDL in hertz server - [bizdemo/hertz_jwt:](bizdemo/hertz_jwt) Example of using jwt in hertz server - [bizdemo/hertz_session:](bizdemo/hertz_session) Example of using distributed session and csrf in hertz server +- [bizdemo/hertz_swagger_gen:](bizdemo/hertz_swagger_gen) Example of using plugin to generate swagger service in hertz server - [bizdemo/tiktok_demo:](bizdemo/tiktok_demo) Example of simple tiktok in hertz server - [formulago:](https://github.com/chenghonour/formulago) Production-level backend management system framework implemented using hertz and ent - [gpress:](https://github.com/springrain/gpress) Production-grade cloud-native high-performance content platform using hertz and zorm diff --git a/README_CN.md b/README_CN.md index 35861d62..585b01b5 100644 --- a/README_CN.md +++ b/README_CN.md @@ -12,6 +12,7 @@ - [hertz_gorm_gen:](bizdemo/hertz_gorm_gen) 在 hertz server 中使用 gorm/gen & proto IDL 的示例 - [hertz_jwt:](bizdemo/hertz_jwt) 在 hertz server 中使用 jwt 的示例 - [hertz_session:](bizdemo/hertz_session) 在 hertz server 中使用分布式 session 和 csrf 的示例 +- [hertz_swagger_gen:](bizdemo/hertz_swagger_gen) 在 hertz server 中使用插件生成 swagger 服务的示例 - [tiktok_demo:](bizdemo/tiktok_demo) 在 hertz server 中实现极简版抖音服务端的示例 - [formulago:](https://github.com/chenghonour/formulago) 使用 hertz 与 ent 实现的生产级别后台管理系统框架 - [gpress:](https://github.com/springrain/gpress) 使用 hertz 与 zorm 实现的生产级别云原生高性能内容平台 diff --git a/bizdemo/hertz_swagger_gen/.gitignore b/bizdemo/hertz_swagger_gen/.gitignore new file mode 100755 index 00000000..101ea87c --- /dev/null +++ b/bizdemo/hertz_swagger_gen/.gitignore @@ -0,0 +1,37 @@ +*.o +*.a +*.so +_obj +_test +*.[568vq] +[568vq].out +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* +_testmain.go +*.exe +*.exe~ +*.test +*.prof +*.rar +*.zip +*.gz +*.psd +*.bmd +*.cfg +*.pptx +*.log +*nohup.out +*settings.pyc +*.sublime-project +*.sublime-workspace +!.gitkeep +.DS_Store +/.idea +/.vscode +/output +*.local.yml +dumped_hertz_remote_config.json + \ No newline at end of file diff --git a/bizdemo/hertz_swagger_gen/.hz b/bizdemo/hertz_swagger_gen/.hz new file mode 100644 index 00000000..b61d4bb6 --- /dev/null +++ b/bizdemo/hertz_swagger_gen/.hz @@ -0,0 +1,6 @@ +// Code generated by hz. DO NOT EDIT. + +hz version: v0.9.1 +handlerDir: "" +modelDir: biz/hertz_gen +routerDir: "" diff --git a/bizdemo/hertz_swagger_gen/Makefile b/bizdemo/hertz_swagger_gen/Makefile new file mode 100644 index 00000000..d3e63b0b --- /dev/null +++ b/bizdemo/hertz_swagger_gen/Makefile @@ -0,0 +1,6 @@ +init_user: + hz new --model_dir biz/hertz_gen -mod github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen -thrift-plugins=http-swagger -idl idl/user.thrift + + +update_user: + hz update --model_dir biz/hertz_gen -thrift-plugins=http-swagger -idl idl/user.thrift \ No newline at end of file diff --git a/bizdemo/hertz_swagger_gen/biz/dal/init.go b/bizdemo/hertz_swagger_gen/biz/dal/init.go new file mode 100644 index 00000000..27d98555 --- /dev/null +++ b/bizdemo/hertz_swagger_gen/biz/dal/init.go @@ -0,0 +1,23 @@ +/* + * Copyright 2024 CloudWeGo Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dal + +import "github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen/biz/dal/mysql" + +func Init() { + mysql.Init() +} diff --git a/bizdemo/hertz_swagger_gen/biz/dal/mysql/init.go b/bizdemo/hertz_swagger_gen/biz/dal/mysql/init.go new file mode 100644 index 00000000..fe05af99 --- /dev/null +++ b/bizdemo/hertz_swagger_gen/biz/dal/mysql/init.go @@ -0,0 +1,39 @@ +/* + * Copyright 2024 CloudWeGo Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package mysql + +import ( + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/logger" +) + +var dsn = "gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True&loc=Local" + +var DB *gorm.DB + +func Init() { + var err error + DB, err = gorm.Open(mysql.Open(dsn), &gorm.Config{ + SkipDefaultTransaction: true, + PrepareStmt: true, + Logger: logger.Default.LogMode(logger.Info), + }) + if err != nil { + panic(err) + } +} diff --git a/bizdemo/hertz_swagger_gen/biz/dal/mysql/user.go b/bizdemo/hertz_swagger_gen/biz/dal/mysql/user.go new file mode 100644 index 00000000..d5ce0a6e --- /dev/null +++ b/bizdemo/hertz_swagger_gen/biz/dal/mysql/user.go @@ -0,0 +1,48 @@ +/* + * Copyright 2024 CloudWeGo Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package mysql + +import "github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen/biz/model" + +func CreateUser(users []*model.User) error { + return DB.Create(users).Error +} + +func DeleteUser(userId int64) error { + return DB.Where("id = ?", userId).Delete(&model.User{}).Error +} + +func UpdateUser(user *model.User) error { + return DB.Updates(user).Error +} + +func QueryUser(keyword *string, page, pageSize int64) ([]*model.User, int64, error) { + db := DB.Model(model.User{}) + if keyword != nil && len(*keyword) != 0 { + db = db.Where(DB.Or("name like ?", "%"+*keyword+"%"). + Or("introduce like ?", "%"+*keyword+"%")) + } + var total int64 + if err := db.Count(&total).Error; err != nil { + return nil, 0, err + } + var res []*model.User + if err := db.Limit(int(pageSize)).Offset(int(pageSize * (page - 1))).Find(&res).Error; err != nil { + return nil, 0, err + } + return res, total, nil +} diff --git a/bizdemo/hertz_swagger_gen/biz/handler/ping.go b/bizdemo/hertz_swagger_gen/biz/handler/ping.go new file mode 100755 index 00000000..950d4767 --- /dev/null +++ b/bizdemo/hertz_swagger_gen/biz/handler/ping.go @@ -0,0 +1,18 @@ +// Code generated by hertz generator. + +package handler + +import ( + "context" + + "github.com/cloudwego/hertz/pkg/app" + "github.com/cloudwego/hertz/pkg/common/utils" + "github.com/cloudwego/hertz/pkg/protocol/consts" +) + +// Ping . +func Ping(ctx context.Context, c *app.RequestContext) { + c.JSON(consts.StatusOK, utils.H{ + "message": "pong", + }) +} diff --git a/bizdemo/hertz_swagger_gen/biz/handler/user/user_service.go b/bizdemo/hertz_swagger_gen/biz/handler/user/user_service.go new file mode 100644 index 00000000..28a5935d --- /dev/null +++ b/bizdemo/hertz_swagger_gen/biz/handler/user/user_service.go @@ -0,0 +1,104 @@ +// Code generated by hertz generator. + +package user + +import ( + "context" + + "github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen/biz/dal/mysql" + user "github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen/biz/hertz_gen/user" + "github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen/biz/model" + "github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen/biz/pack" + "github.com/cloudwego/hertz/pkg/app" + "github.com/cloudwego/hertz/pkg/protocol/consts" +) + +// UpdateUser . +// @router /v1/user/update/:user_id [POST] +func UpdateUser(ctx context.Context, c *app.RequestContext) { + var err error + var req user.UpdateUserRequest + err = c.BindAndValidate(&req) + if err != nil { + c.JSON(consts.StatusBadRequest, &user.UpdateUserResponse{Code: user.Code_ParamInvalid, Msg: err.Error()}) + return + } + + u := &model.User{} + u.ID = uint(req.UserID) + u.Name = req.Name + u.Gender = int64(req.Gender) + u.Age = req.Age + u.Introduce = req.Introduce + + if err = mysql.UpdateUser(u); err != nil { + c.JSON(consts.StatusInternalServerError, &user.UpdateUserResponse{Code: user.Code_DBErr, Msg: err.Error()}) + return + } + + c.JSON(consts.StatusOK, &user.UpdateUserResponse{Code: user.Code_Success}) +} + +// DeleteUser . +// @router /v1/user/delete/:user_id [POST] +func DeleteUser(ctx context.Context, c *app.RequestContext) { + var err error + var req user.DeleteUserRequest + err = c.BindAndValidate(&req) + if err != nil { + c.JSON(consts.StatusBadRequest, &user.DeleteUserResponse{Code: user.Code_ParamInvalid, Msg: err.Error()}) + return + } + if err = mysql.DeleteUser(req.UserID); err != nil { + c.JSON(consts.StatusInternalServerError, &user.DeleteUserResponse{Code: user.Code_DBErr, Msg: err.Error()}) + return + } + + c.JSON(consts.StatusOK, &user.DeleteUserResponse{Code: user.Code_Success}) +} + +// QueryUser . +// @router /v1/user/query/ [POST] +func QueryUser(ctx context.Context, c *app.RequestContext) { + var err error + var req user.QueryUserRequest + err = c.BindAndValidate(&req) + if err != nil { + c.JSON(consts.StatusBadRequest, &user.QueryUserResponse{Code: user.Code_ParamInvalid, Msg: err.Error()}) + return + } + + users, total, err := mysql.QueryUser(req.Keyword, req.Page, req.PageSize) + if err != nil { + c.JSON(consts.StatusInternalServerError, &user.QueryUserResponse{Code: user.Code_DBErr, Msg: err.Error()}) + return + } + c.JSON(consts.StatusOK, &user.QueryUserResponse{Code: user.Code_Success, Users: pack.Users(users), Total: total}) +} + +// CreateUser . +// @router /v1/user/create/ [POST] +func CreateUser(ctx context.Context, c *app.RequestContext) { + var err error + var req user.CreateUserRequest + err = c.BindAndValidate(&req) + if err != nil { + c.JSON(consts.StatusBadRequest, &user.CreateUserResponse{Code: user.Code_ParamInvalid, Msg: err.Error()}) + return + } + if err = mysql.CreateUser([]*model.User{ + { + Name: req.Name, + Gender: int64(req.Gender), + Age: req.Age, + Introduce: req.Introduce, + }, + }); err != nil { + c.JSON(consts.StatusInternalServerError, &user.CreateUserResponse{Code: user.Code_DBErr, Msg: err.Error()}) + return + } + + resp := new(user.CreateUserResponse) + resp.Code = user.Code_Success + c.JSON(consts.StatusOK, resp) +} diff --git a/bizdemo/hertz_swagger_gen/biz/hertz_gen/openapi/openapi.go b/bizdemo/hertz_swagger_gen/biz/hertz_gen/openapi/openapi.go new file mode 100644 index 00000000..3ef90b3d --- /dev/null +++ b/bizdemo/hertz_swagger_gen/biz/hertz_gen/openapi/openapi.go @@ -0,0 +1,23419 @@ +// Code generated by thriftgo (0.3.14). DO NOT EDIT. + +package openapi + +import ( + "fmt" + "github.com/apache/thrift/lib/go/thrift" +) + +type _ServiceOptions struct { + Document *Document `thrift:"document,1,required" form:"document,required" json:"document,required" query:"document,required"` +} + +func New_ServiceOptions() *_ServiceOptions { + return &_ServiceOptions{} +} + +func (p *_ServiceOptions) InitDefault() { +} + +var _ServiceOptions_Document_DEFAULT *Document + +func (p *_ServiceOptions) GetDocument() (v *Document) { + if !p.IsSetDocument() { + return _ServiceOptions_Document_DEFAULT + } + return p.Document +} + +var fieldIDToName__ServiceOptions = map[int16]string{ + 1: "document", +} + +func (p *_ServiceOptions) IsSetDocument() bool { + return p.Document != nil +} + +func (p *_ServiceOptions) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetDocument bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetDocument = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetDocument { + fieldId = 1 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName__ServiceOptions[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName__ServiceOptions[fieldId])) +} + +func (p *_ServiceOptions) ReadField1(iprot thrift.TProtocol) error { + _field := NewDocument() + if err := _field.Read(iprot); err != nil { + return err + } + p.Document = _field + return nil +} + +func (p *_ServiceOptions) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("_ServiceOptions"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *_ServiceOptions) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("document", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Document.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *_ServiceOptions) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("_ServiceOptions(%+v)", *p) + +} + +type _StructOptions struct { + Schema *Schema `thrift:"schema,1,required" form:"schema,required" json:"schema,required" query:"schema,required"` +} + +func New_StructOptions() *_StructOptions { + return &_StructOptions{} +} + +func (p *_StructOptions) InitDefault() { +} + +var _StructOptions_Schema_DEFAULT *Schema + +func (p *_StructOptions) GetSchema() (v *Schema) { + if !p.IsSetSchema() { + return _StructOptions_Schema_DEFAULT + } + return p.Schema +} + +var fieldIDToName__StructOptions = map[int16]string{ + 1: "schema", +} + +func (p *_StructOptions) IsSetSchema() bool { + return p.Schema != nil +} + +func (p *_StructOptions) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetSchema bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetSchema = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetSchema { + fieldId = 1 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName__StructOptions[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName__StructOptions[fieldId])) +} + +func (p *_StructOptions) ReadField1(iprot thrift.TProtocol) error { + _field := NewSchema() + if err := _field.Read(iprot); err != nil { + return err + } + p.Schema = _field + return nil +} + +func (p *_StructOptions) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("_StructOptions"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *_StructOptions) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("schema", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Schema.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *_StructOptions) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("_StructOptions(%+v)", *p) + +} + +type _MethodOptions struct { + Operation *Operation `thrift:"operation,1,required" form:"operation,required" json:"operation,required" query:"operation,required"` +} + +func New_MethodOptions() *_MethodOptions { + return &_MethodOptions{} +} + +func (p *_MethodOptions) InitDefault() { +} + +var _MethodOptions_Operation_DEFAULT *Operation + +func (p *_MethodOptions) GetOperation() (v *Operation) { + if !p.IsSetOperation() { + return _MethodOptions_Operation_DEFAULT + } + return p.Operation +} + +var fieldIDToName__MethodOptions = map[int16]string{ + 1: "operation", +} + +func (p *_MethodOptions) IsSetOperation() bool { + return p.Operation != nil +} + +func (p *_MethodOptions) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetOperation bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetOperation = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetOperation { + fieldId = 1 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName__MethodOptions[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName__MethodOptions[fieldId])) +} + +func (p *_MethodOptions) ReadField1(iprot thrift.TProtocol) error { + _field := NewOperation() + if err := _field.Read(iprot); err != nil { + return err + } + p.Operation = _field + return nil +} + +func (p *_MethodOptions) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("_MethodOptions"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *_MethodOptions) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("operation", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Operation.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *_MethodOptions) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("_MethodOptions(%+v)", *p) + +} + +type _FieldOptions struct { + Parameter *Parameter `thrift:"parameter,1,required" form:"parameter,required" json:"parameter,required" query:"parameter,required"` + Property *Schema `thrift:"property,2,required" form:"property,required" json:"property,required" query:"property,required"` +} + +func New_FieldOptions() *_FieldOptions { + return &_FieldOptions{} +} + +func (p *_FieldOptions) InitDefault() { +} + +var _FieldOptions_Parameter_DEFAULT *Parameter + +func (p *_FieldOptions) GetParameter() (v *Parameter) { + if !p.IsSetParameter() { + return _FieldOptions_Parameter_DEFAULT + } + return p.Parameter +} + +var _FieldOptions_Property_DEFAULT *Schema + +func (p *_FieldOptions) GetProperty() (v *Schema) { + if !p.IsSetProperty() { + return _FieldOptions_Property_DEFAULT + } + return p.Property +} + +var fieldIDToName__FieldOptions = map[int16]string{ + 1: "parameter", + 2: "property", +} + +func (p *_FieldOptions) IsSetParameter() bool { + return p.Parameter != nil +} + +func (p *_FieldOptions) IsSetProperty() bool { + return p.Property != nil +} + +func (p *_FieldOptions) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetParameter bool = false + var issetProperty bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetParameter = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + issetProperty = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetParameter { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetProperty { + fieldId = 2 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName__FieldOptions[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName__FieldOptions[fieldId])) +} + +func (p *_FieldOptions) ReadField1(iprot thrift.TProtocol) error { + _field := NewParameter() + if err := _field.Read(iprot); err != nil { + return err + } + p.Parameter = _field + return nil +} +func (p *_FieldOptions) ReadField2(iprot thrift.TProtocol) error { + _field := NewSchema() + if err := _field.Read(iprot); err != nil { + return err + } + p.Property = _field + return nil +} + +func (p *_FieldOptions) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("_FieldOptions"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *_FieldOptions) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("parameter", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Parameter.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *_FieldOptions) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("property", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Property.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *_FieldOptions) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("_FieldOptions(%+v)", *p) + +} + +type AdditionalPropertiesItem struct { + SchemaOrReference *SchemaOrReference `thrift:"schema_or_reference,1" form:"schema_or_reference" json:"schema_or_reference" query:"schema_or_reference"` + Boolean bool `thrift:"boolean,2" form:"boolean" json:"boolean" query:"boolean"` +} + +func NewAdditionalPropertiesItem() *AdditionalPropertiesItem { + return &AdditionalPropertiesItem{} +} + +func (p *AdditionalPropertiesItem) InitDefault() { +} + +var AdditionalPropertiesItem_SchemaOrReference_DEFAULT *SchemaOrReference + +func (p *AdditionalPropertiesItem) GetSchemaOrReference() (v *SchemaOrReference) { + if !p.IsSetSchemaOrReference() { + return AdditionalPropertiesItem_SchemaOrReference_DEFAULT + } + return p.SchemaOrReference +} + +func (p *AdditionalPropertiesItem) GetBoolean() (v bool) { + return p.Boolean +} + +var fieldIDToName_AdditionalPropertiesItem = map[int16]string{ + 1: "schema_or_reference", + 2: "boolean", +} + +func (p *AdditionalPropertiesItem) IsSetSchemaOrReference() bool { + return p.SchemaOrReference != nil +} + +func (p *AdditionalPropertiesItem) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AdditionalPropertiesItem[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *AdditionalPropertiesItem) ReadField1(iprot thrift.TProtocol) error { + _field := NewSchemaOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.SchemaOrReference = _field + return nil +} +func (p *AdditionalPropertiesItem) ReadField2(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Boolean = _field + return nil +} + +func (p *AdditionalPropertiesItem) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AdditionalPropertiesItem"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *AdditionalPropertiesItem) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("schema_or_reference", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.SchemaOrReference.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *AdditionalPropertiesItem) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("boolean", thrift.BOOL, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Boolean); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *AdditionalPropertiesItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdditionalPropertiesItem(%+v)", *p) + +} + +type Any struct { + Value *_Any `thrift:"value,1" form:"value" json:"value" query:"value"` + Yaml string `thrift:"yaml,2" form:"yaml" json:"yaml" query:"yaml"` +} + +func NewAny() *Any { + return &Any{} +} + +func (p *Any) InitDefault() { +} + +var Any_Value_DEFAULT *_Any + +func (p *Any) GetValue() (v *_Any) { + if !p.IsSetValue() { + return Any_Value_DEFAULT + } + return p.Value +} + +func (p *Any) GetYaml() (v string) { + return p.Yaml +} + +var fieldIDToName_Any = map[int16]string{ + 1: "value", + 2: "yaml", +} + +func (p *Any) IsSetValue() bool { + return p.Value != nil +} + +func (p *Any) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Any[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Any) ReadField1(iprot thrift.TProtocol) error { + _field := New_Any() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} +func (p *Any) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Yaml = _field + return nil +} + +func (p *Any) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Any"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Any) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Any) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("yaml", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Yaml); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Any) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Any(%+v)", *p) + +} + +type _Any struct { + TypeURL string `thrift:"type_url,1" form:"type_url" json:"type_url" query:"type_url"` + Value []byte `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func New_Any() *_Any { + return &_Any{} +} + +func (p *_Any) InitDefault() { +} + +func (p *_Any) GetTypeURL() (v string) { + return p.TypeURL +} + +func (p *_Any) GetValue() (v []byte) { + return p.Value +} + +var fieldIDToName__Any = map[int16]string{ + 1: "type_url", + 2: "value", +} + +func (p *_Any) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName__Any[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *_Any) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.TypeURL = _field + return nil +} +func (p *_Any) ReadField2(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.Value = _field + return nil +} + +func (p *_Any) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("_Any"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *_Any) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("type_url", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.TypeURL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *_Any) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.Value)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *_Any) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("_Any(%+v)", *p) + +} + +type AnyOrExpression struct { + Any *Any `thrift:"any,1" form:"any" json:"any" query:"any"` + Expression *Expression `thrift:"expression,2" form:"expression" json:"expression" query:"expression"` +} + +func NewAnyOrExpression() *AnyOrExpression { + return &AnyOrExpression{} +} + +func (p *AnyOrExpression) InitDefault() { +} + +var AnyOrExpression_Any_DEFAULT *Any + +func (p *AnyOrExpression) GetAny() (v *Any) { + if !p.IsSetAny() { + return AnyOrExpression_Any_DEFAULT + } + return p.Any +} + +var AnyOrExpression_Expression_DEFAULT *Expression + +func (p *AnyOrExpression) GetExpression() (v *Expression) { + if !p.IsSetExpression() { + return AnyOrExpression_Expression_DEFAULT + } + return p.Expression +} + +var fieldIDToName_AnyOrExpression = map[int16]string{ + 1: "any", + 2: "expression", +} + +func (p *AnyOrExpression) IsSetAny() bool { + return p.Any != nil +} + +func (p *AnyOrExpression) IsSetExpression() bool { + return p.Expression != nil +} + +func (p *AnyOrExpression) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AnyOrExpression[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *AnyOrExpression) ReadField1(iprot thrift.TProtocol) error { + _field := NewAny() + if err := _field.Read(iprot); err != nil { + return err + } + p.Any = _field + return nil +} +func (p *AnyOrExpression) ReadField2(iprot thrift.TProtocol) error { + _field := NewExpression() + if err := _field.Read(iprot); err != nil { + return err + } + p.Expression = _field + return nil +} + +func (p *AnyOrExpression) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AnyOrExpression"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *AnyOrExpression) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("any", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Any.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *AnyOrExpression) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("expression", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Expression.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *AnyOrExpression) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AnyOrExpression(%+v)", *p) + +} + +type Callback struct { + Path []*NamedPathItem `thrift:"path,1" form:"path" json:"path" query:"path"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,2" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewCallback() *Callback { + return &Callback{} +} + +func (p *Callback) InitDefault() { +} + +func (p *Callback) GetPath() (v []*NamedPathItem) { + return p.Path +} + +func (p *Callback) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Callback = map[int16]string{ + 1: "path", + 2: "specification_extension", +} + +func (p *Callback) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.LIST { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Callback[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Callback) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedPathItem, 0, size) + values := make([]NamedPathItem, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Path = _field + return nil +} +func (p *Callback) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Callback) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Callback"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Callback) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("path", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Path)); err != nil { + return err + } + for _, v := range p.Path { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Callback) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Callback) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Callback(%+v)", *p) + +} + +type CallbackOrReference struct { + Callback *Callback `thrift:"callback,1" form:"callback" json:"callback" query:"callback"` + Reference *Reference `thrift:"reference,2" form:"reference" json:"reference" query:"reference"` +} + +func NewCallbackOrReference() *CallbackOrReference { + return &CallbackOrReference{} +} + +func (p *CallbackOrReference) InitDefault() { +} + +var CallbackOrReference_Callback_DEFAULT *Callback + +func (p *CallbackOrReference) GetCallback() (v *Callback) { + if !p.IsSetCallback() { + return CallbackOrReference_Callback_DEFAULT + } + return p.Callback +} + +var CallbackOrReference_Reference_DEFAULT *Reference + +func (p *CallbackOrReference) GetReference() (v *Reference) { + if !p.IsSetReference() { + return CallbackOrReference_Reference_DEFAULT + } + return p.Reference +} + +var fieldIDToName_CallbackOrReference = map[int16]string{ + 1: "callback", + 2: "reference", +} + +func (p *CallbackOrReference) IsSetCallback() bool { + return p.Callback != nil +} + +func (p *CallbackOrReference) IsSetReference() bool { + return p.Reference != nil +} + +func (p *CallbackOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CallbackOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CallbackOrReference) ReadField1(iprot thrift.TProtocol) error { + _field := NewCallback() + if err := _field.Read(iprot); err != nil { + return err + } + p.Callback = _field + return nil +} +func (p *CallbackOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Reference = _field + return nil +} + +func (p *CallbackOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CallbackOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *CallbackOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("callback", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Callback.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *CallbackOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Reference.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *CallbackOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CallbackOrReference(%+v)", *p) + +} + +type CallbacksOrReferences struct { + AdditionalProperties []*NamedCallbackOrReference `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewCallbacksOrReferences() *CallbacksOrReferences { + return &CallbacksOrReferences{} +} + +func (p *CallbacksOrReferences) InitDefault() { +} + +func (p *CallbacksOrReferences) GetAdditionalProperties() (v []*NamedCallbackOrReference) { + return p.AdditionalProperties +} + +var fieldIDToName_CallbacksOrReferences = map[int16]string{ + 1: "additional_properties", +} + +func (p *CallbacksOrReferences) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CallbacksOrReferences[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CallbacksOrReferences) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedCallbackOrReference, 0, size) + values := make([]NamedCallbackOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *CallbacksOrReferences) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CallbacksOrReferences"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *CallbacksOrReferences) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *CallbacksOrReferences) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CallbacksOrReferences(%+v)", *p) + +} + +type Components struct { + Schemas *SchemasOrReferences `thrift:"schemas,1" form:"schemas" json:"schemas" query:"schemas"` + Responses *ResponsesOrReferences `thrift:"responses,2" form:"responses" json:"responses" query:"responses"` + Parameters *ParametersOrReferences `thrift:"parameters,3" form:"parameters" json:"parameters" query:"parameters"` + Examples *ExamplesOrReferences `thrift:"examples,4" form:"examples" json:"examples" query:"examples"` + RequestBodies *RequestBodiesOrReferences `thrift:"request_bodies,5" form:"request_bodies" json:"request_bodies" query:"request_bodies"` + Headers *HeadersOrReferences `thrift:"headers,6" form:"headers" json:"headers" query:"headers"` + SecuritySchemes *SecuritySchemesOrReferences `thrift:"security_schemes,7" form:"security_schemes" json:"security_schemes" query:"security_schemes"` + Links *LinksOrReferences `thrift:"links,8" form:"links" json:"links" query:"links"` + Callbacks *CallbacksOrReferences `thrift:"callbacks,9" form:"callbacks" json:"callbacks" query:"callbacks"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,10" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewComponents() *Components { + return &Components{} +} + +func (p *Components) InitDefault() { +} + +var Components_Schemas_DEFAULT *SchemasOrReferences + +func (p *Components) GetSchemas() (v *SchemasOrReferences) { + if !p.IsSetSchemas() { + return Components_Schemas_DEFAULT + } + return p.Schemas +} + +var Components_Responses_DEFAULT *ResponsesOrReferences + +func (p *Components) GetResponses() (v *ResponsesOrReferences) { + if !p.IsSetResponses() { + return Components_Responses_DEFAULT + } + return p.Responses +} + +var Components_Parameters_DEFAULT *ParametersOrReferences + +func (p *Components) GetParameters() (v *ParametersOrReferences) { + if !p.IsSetParameters() { + return Components_Parameters_DEFAULT + } + return p.Parameters +} + +var Components_Examples_DEFAULT *ExamplesOrReferences + +func (p *Components) GetExamples() (v *ExamplesOrReferences) { + if !p.IsSetExamples() { + return Components_Examples_DEFAULT + } + return p.Examples +} + +var Components_RequestBodies_DEFAULT *RequestBodiesOrReferences + +func (p *Components) GetRequestBodies() (v *RequestBodiesOrReferences) { + if !p.IsSetRequestBodies() { + return Components_RequestBodies_DEFAULT + } + return p.RequestBodies +} + +var Components_Headers_DEFAULT *HeadersOrReferences + +func (p *Components) GetHeaders() (v *HeadersOrReferences) { + if !p.IsSetHeaders() { + return Components_Headers_DEFAULT + } + return p.Headers +} + +var Components_SecuritySchemes_DEFAULT *SecuritySchemesOrReferences + +func (p *Components) GetSecuritySchemes() (v *SecuritySchemesOrReferences) { + if !p.IsSetSecuritySchemes() { + return Components_SecuritySchemes_DEFAULT + } + return p.SecuritySchemes +} + +var Components_Links_DEFAULT *LinksOrReferences + +func (p *Components) GetLinks() (v *LinksOrReferences) { + if !p.IsSetLinks() { + return Components_Links_DEFAULT + } + return p.Links +} + +var Components_Callbacks_DEFAULT *CallbacksOrReferences + +func (p *Components) GetCallbacks() (v *CallbacksOrReferences) { + if !p.IsSetCallbacks() { + return Components_Callbacks_DEFAULT + } + return p.Callbacks +} + +func (p *Components) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Components = map[int16]string{ + 1: "schemas", + 2: "responses", + 3: "parameters", + 4: "examples", + 5: "request_bodies", + 6: "headers", + 7: "security_schemes", + 8: "links", + 9: "callbacks", + 10: "specification_extension", +} + +func (p *Components) IsSetSchemas() bool { + return p.Schemas != nil +} + +func (p *Components) IsSetResponses() bool { + return p.Responses != nil +} + +func (p *Components) IsSetParameters() bool { + return p.Parameters != nil +} + +func (p *Components) IsSetExamples() bool { + return p.Examples != nil +} + +func (p *Components) IsSetRequestBodies() bool { + return p.RequestBodies != nil +} + +func (p *Components) IsSetHeaders() bool { + return p.Headers != nil +} + +func (p *Components) IsSetSecuritySchemes() bool { + return p.SecuritySchemes != nil +} + +func (p *Components) IsSetLinks() bool { + return p.Links != nil +} + +func (p *Components) IsSetCallbacks() bool { + return p.Callbacks != nil +} + +func (p *Components) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.LIST { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Components[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Components) ReadField1(iprot thrift.TProtocol) error { + _field := NewSchemasOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.Schemas = _field + return nil +} +func (p *Components) ReadField2(iprot thrift.TProtocol) error { + _field := NewResponsesOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.Responses = _field + return nil +} +func (p *Components) ReadField3(iprot thrift.TProtocol) error { + _field := NewParametersOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.Parameters = _field + return nil +} +func (p *Components) ReadField4(iprot thrift.TProtocol) error { + _field := NewExamplesOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.Examples = _field + return nil +} +func (p *Components) ReadField5(iprot thrift.TProtocol) error { + _field := NewRequestBodiesOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.RequestBodies = _field + return nil +} +func (p *Components) ReadField6(iprot thrift.TProtocol) error { + _field := NewHeadersOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.Headers = _field + return nil +} +func (p *Components) ReadField7(iprot thrift.TProtocol) error { + _field := NewSecuritySchemesOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.SecuritySchemes = _field + return nil +} +func (p *Components) ReadField8(iprot thrift.TProtocol) error { + _field := NewLinksOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.Links = _field + return nil +} +func (p *Components) ReadField9(iprot thrift.TProtocol) error { + _field := NewCallbacksOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.Callbacks = _field + return nil +} +func (p *Components) ReadField10(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Components) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Components"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Components) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("schemas", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Schemas.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Components) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("responses", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Responses.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Components) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("parameters", thrift.STRUCT, 3); err != nil { + goto WriteFieldBeginError + } + if err := p.Parameters.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Components) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("examples", thrift.STRUCT, 4); err != nil { + goto WriteFieldBeginError + } + if err := p.Examples.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Components) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request_bodies", thrift.STRUCT, 5); err != nil { + goto WriteFieldBeginError + } + if err := p.RequestBodies.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Components) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("headers", thrift.STRUCT, 6); err != nil { + goto WriteFieldBeginError + } + if err := p.Headers.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *Components) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("security_schemes", thrift.STRUCT, 7); err != nil { + goto WriteFieldBeginError + } + if err := p.SecuritySchemes.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *Components) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("links", thrift.STRUCT, 8); err != nil { + goto WriteFieldBeginError + } + if err := p.Links.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *Components) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("callbacks", thrift.STRUCT, 9); err != nil { + goto WriteFieldBeginError + } + if err := p.Callbacks.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *Components) writeField10(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *Components) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Components(%+v)", *p) + +} + +type Contact struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + URL string `thrift:"url,2" form:"url" json:"url" query:"url"` + Email string `thrift:"email,3" form:"email" json:"email" query:"email"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,4" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewContact() *Contact { + return &Contact{} +} + +func (p *Contact) InitDefault() { +} + +func (p *Contact) GetName() (v string) { + return p.Name +} + +func (p *Contact) GetURL() (v string) { + return p.URL +} + +func (p *Contact) GetEmail() (v string) { + return p.Email +} + +func (p *Contact) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Contact = map[int16]string{ + 1: "name", + 2: "url", + 3: "email", + 4: "specification_extension", +} + +func (p *Contact) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.LIST { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Contact[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Contact) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *Contact) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.URL = _field + return nil +} +func (p *Contact) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Email = _field + return nil +} +func (p *Contact) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Contact) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Contact"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Contact) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Contact) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.URL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Contact) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("email", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Email); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Contact) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Contact) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Contact(%+v)", *p) + +} + +type DefaultType struct { + Number float64 `thrift:"number,1" form:"number" json:"number" query:"number"` + Boolean bool `thrift:"boolean,2" form:"boolean" json:"boolean" query:"boolean"` + String_ string `thrift:"string,3" form:"string" json:"string" query:"string"` +} + +func NewDefaultType() *DefaultType { + return &DefaultType{} +} + +func (p *DefaultType) InitDefault() { +} + +func (p *DefaultType) GetNumber() (v float64) { + return p.Number +} + +func (p *DefaultType) GetBoolean() (v bool) { + return p.Boolean +} + +func (p *DefaultType) GetString() (v string) { + return p.String_ +} + +var fieldIDToName_DefaultType = map[int16]string{ + 1: "number", + 2: "boolean", + 3: "string", +} + +func (p *DefaultType) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.DOUBLE { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DefaultType[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *DefaultType) ReadField1(iprot thrift.TProtocol) error { + + var _field float64 + if v, err := iprot.ReadDouble(); err != nil { + return err + } else { + _field = v + } + p.Number = _field + return nil +} +func (p *DefaultType) ReadField2(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Boolean = _field + return nil +} +func (p *DefaultType) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.String_ = _field + return nil +} + +func (p *DefaultType) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DefaultType"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *DefaultType) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("number", thrift.DOUBLE, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteDouble(p.Number); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *DefaultType) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("boolean", thrift.BOOL, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Boolean); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *DefaultType) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("string", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.String_); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *DefaultType) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DefaultType(%+v)", *p) + +} + +type Discriminator struct { + PropertyName string `thrift:"property_name,1" form:"property_name" json:"property_name" query:"property_name"` + Mapping *Strings `thrift:"mapping,2" form:"mapping" json:"mapping" query:"mapping"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,3" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewDiscriminator() *Discriminator { + return &Discriminator{} +} + +func (p *Discriminator) InitDefault() { +} + +func (p *Discriminator) GetPropertyName() (v string) { + return p.PropertyName +} + +var Discriminator_Mapping_DEFAULT *Strings + +func (p *Discriminator) GetMapping() (v *Strings) { + if !p.IsSetMapping() { + return Discriminator_Mapping_DEFAULT + } + return p.Mapping +} + +func (p *Discriminator) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Discriminator = map[int16]string{ + 1: "property_name", + 2: "mapping", + 3: "specification_extension", +} + +func (p *Discriminator) IsSetMapping() bool { + return p.Mapping != nil +} + +func (p *Discriminator) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.LIST { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Discriminator[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Discriminator) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.PropertyName = _field + return nil +} +func (p *Discriminator) ReadField2(iprot thrift.TProtocol) error { + _field := NewStrings() + if err := _field.Read(iprot); err != nil { + return err + } + p.Mapping = _field + return nil +} +func (p *Discriminator) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Discriminator) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Discriminator"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Discriminator) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("property_name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.PropertyName); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Discriminator) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("mapping", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Mapping.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Discriminator) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Discriminator) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Discriminator(%+v)", *p) + +} + +type Document struct { + Openapi string `thrift:"openapi,1" form:"openapi" json:"openapi" query:"openapi"` + Info *Info `thrift:"info,2" form:"info" json:"info" query:"info"` + Servers []*Server `thrift:"servers,3" form:"servers" json:"servers" query:"servers"` + Paths *Paths `thrift:"paths,4" form:"paths" json:"paths" query:"paths"` + Components *Components `thrift:"components,5" form:"components" json:"components" query:"components"` + Security []*SecurityRequirement `thrift:"security,6" form:"security" json:"security" query:"security"` + Tags []*Tag `thrift:"tags,7" form:"tags" json:"tags" query:"tags"` + ExternalDocs *ExternalDocs `thrift:"external_docs,8" form:"external_docs" json:"external_docs" query:"external_docs"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,9" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewDocument() *Document { + return &Document{} +} + +func (p *Document) InitDefault() { +} + +func (p *Document) GetOpenapi() (v string) { + return p.Openapi +} + +var Document_Info_DEFAULT *Info + +func (p *Document) GetInfo() (v *Info) { + if !p.IsSetInfo() { + return Document_Info_DEFAULT + } + return p.Info +} + +func (p *Document) GetServers() (v []*Server) { + return p.Servers +} + +var Document_Paths_DEFAULT *Paths + +func (p *Document) GetPaths() (v *Paths) { + if !p.IsSetPaths() { + return Document_Paths_DEFAULT + } + return p.Paths +} + +var Document_Components_DEFAULT *Components + +func (p *Document) GetComponents() (v *Components) { + if !p.IsSetComponents() { + return Document_Components_DEFAULT + } + return p.Components +} + +func (p *Document) GetSecurity() (v []*SecurityRequirement) { + return p.Security +} + +func (p *Document) GetTags() (v []*Tag) { + return p.Tags +} + +var Document_ExternalDocs_DEFAULT *ExternalDocs + +func (p *Document) GetExternalDocs() (v *ExternalDocs) { + if !p.IsSetExternalDocs() { + return Document_ExternalDocs_DEFAULT + } + return p.ExternalDocs +} + +func (p *Document) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Document = map[int16]string{ + 1: "openapi", + 2: "info", + 3: "servers", + 4: "paths", + 5: "components", + 6: "security", + 7: "tags", + 8: "external_docs", + 9: "specification_extension", +} + +func (p *Document) IsSetInfo() bool { + return p.Info != nil +} + +func (p *Document) IsSetPaths() bool { + return p.Paths != nil +} + +func (p *Document) IsSetComponents() bool { + return p.Components != nil +} + +func (p *Document) IsSetExternalDocs() bool { + return p.ExternalDocs != nil +} + +func (p *Document) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.LIST { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.LIST { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.LIST { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.LIST { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Document[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Document) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Openapi = _field + return nil +} +func (p *Document) ReadField2(iprot thrift.TProtocol) error { + _field := NewInfo() + if err := _field.Read(iprot); err != nil { + return err + } + p.Info = _field + return nil +} +func (p *Document) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*Server, 0, size) + values := make([]Server, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Servers = _field + return nil +} +func (p *Document) ReadField4(iprot thrift.TProtocol) error { + _field := NewPaths() + if err := _field.Read(iprot); err != nil { + return err + } + p.Paths = _field + return nil +} +func (p *Document) ReadField5(iprot thrift.TProtocol) error { + _field := NewComponents() + if err := _field.Read(iprot); err != nil { + return err + } + p.Components = _field + return nil +} +func (p *Document) ReadField6(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*SecurityRequirement, 0, size) + values := make([]SecurityRequirement, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Security = _field + return nil +} +func (p *Document) ReadField7(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*Tag, 0, size) + values := make([]Tag, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Tags = _field + return nil +} +func (p *Document) ReadField8(iprot thrift.TProtocol) error { + _field := NewExternalDocs() + if err := _field.Read(iprot); err != nil { + return err + } + p.ExternalDocs = _field + return nil +} +func (p *Document) ReadField9(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Document) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Document"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Document) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("openapi", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Openapi); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Document) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("info", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Info.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Document) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("servers", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Servers)); err != nil { + return err + } + for _, v := range p.Servers { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Document) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("paths", thrift.STRUCT, 4); err != nil { + goto WriteFieldBeginError + } + if err := p.Paths.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Document) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("components", thrift.STRUCT, 5); err != nil { + goto WriteFieldBeginError + } + if err := p.Components.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Document) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("security", thrift.LIST, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Security)); err != nil { + return err + } + for _, v := range p.Security { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *Document) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("tags", thrift.LIST, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { + return err + } + for _, v := range p.Tags { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *Document) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("external_docs", thrift.STRUCT, 8); err != nil { + goto WriteFieldBeginError + } + if err := p.ExternalDocs.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *Document) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *Document) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Document(%+v)", *p) + +} + +type Encoding struct { + ContentType string `thrift:"content_type,1" form:"content_type" json:"content_type" query:"content_type"` + Headers *HeadersOrReferences `thrift:"headers,2" form:"headers" json:"headers" query:"headers"` + Style string `thrift:"style,3" form:"style" json:"style" query:"style"` + Explode bool `thrift:"explode,4" form:"explode" json:"explode" query:"explode"` + AllowReserved bool `thrift:"allow_reserved,5" form:"allow_reserved" json:"allow_reserved" query:"allow_reserved"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,6" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewEncoding() *Encoding { + return &Encoding{} +} + +func (p *Encoding) InitDefault() { +} + +func (p *Encoding) GetContentType() (v string) { + return p.ContentType +} + +var Encoding_Headers_DEFAULT *HeadersOrReferences + +func (p *Encoding) GetHeaders() (v *HeadersOrReferences) { + if !p.IsSetHeaders() { + return Encoding_Headers_DEFAULT + } + return p.Headers +} + +func (p *Encoding) GetStyle() (v string) { + return p.Style +} + +func (p *Encoding) GetExplode() (v bool) { + return p.Explode +} + +func (p *Encoding) GetAllowReserved() (v bool) { + return p.AllowReserved +} + +func (p *Encoding) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Encoding = map[int16]string{ + 1: "content_type", + 2: "headers", + 3: "style", + 4: "explode", + 5: "allow_reserved", + 6: "specification_extension", +} + +func (p *Encoding) IsSetHeaders() bool { + return p.Headers != nil +} + +func (p *Encoding) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.LIST { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Encoding[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Encoding) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.ContentType = _field + return nil +} +func (p *Encoding) ReadField2(iprot thrift.TProtocol) error { + _field := NewHeadersOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.Headers = _field + return nil +} +func (p *Encoding) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Style = _field + return nil +} +func (p *Encoding) ReadField4(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Explode = _field + return nil +} +func (p *Encoding) ReadField5(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.AllowReserved = _field + return nil +} +func (p *Encoding) ReadField6(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Encoding) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Encoding"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Encoding) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("content_type", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.ContentType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Encoding) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("headers", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Headers.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Encoding) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("style", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Style); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Encoding) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("explode", thrift.BOOL, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Explode); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Encoding) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("allow_reserved", thrift.BOOL, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.AllowReserved); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Encoding) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *Encoding) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Encoding(%+v)", *p) + +} + +type Encodings struct { + AdditionalProperties []*NamedEncoding `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewEncodings() *Encodings { + return &Encodings{} +} + +func (p *Encodings) InitDefault() { +} + +func (p *Encodings) GetAdditionalProperties() (v []*NamedEncoding) { + return p.AdditionalProperties +} + +var fieldIDToName_Encodings = map[int16]string{ + 1: "additional_properties", +} + +func (p *Encodings) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Encodings[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Encodings) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedEncoding, 0, size) + values := make([]NamedEncoding, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *Encodings) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Encodings"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Encodings) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Encodings) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Encodings(%+v)", *p) + +} + +type Example struct { + Summary string `thrift:"summary,1" form:"summary" json:"summary" query:"summary"` + Description string `thrift:"description,2" form:"description" json:"description" query:"description"` + Value *Any `thrift:"value,3" form:"value" json:"value" query:"value"` + ExternalValue string `thrift:"external_value,4" form:"external_value" json:"external_value" query:"external_value"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,5" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewExample() *Example { + return &Example{} +} + +func (p *Example) InitDefault() { +} + +func (p *Example) GetSummary() (v string) { + return p.Summary +} + +func (p *Example) GetDescription() (v string) { + return p.Description +} + +var Example_Value_DEFAULT *Any + +func (p *Example) GetValue() (v *Any) { + if !p.IsSetValue() { + return Example_Value_DEFAULT + } + return p.Value +} + +func (p *Example) GetExternalValue() (v string) { + return p.ExternalValue +} + +func (p *Example) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Example = map[int16]string{ + 1: "summary", + 2: "description", + 3: "value", + 4: "external_value", + 5: "specification_extension", +} + +func (p *Example) IsSetValue() bool { + return p.Value != nil +} + +func (p *Example) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.LIST { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Example[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Example) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Summary = _field + return nil +} +func (p *Example) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *Example) ReadField3(iprot thrift.TProtocol) error { + _field := NewAny() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} +func (p *Example) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.ExternalValue = _field + return nil +} +func (p *Example) ReadField5(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Example) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Example"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Example) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("summary", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Summary); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Example) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Example) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 3); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Example) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("external_value", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.ExternalValue); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Example) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Example) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Example(%+v)", *p) + +} + +type ExampleOrReference struct { + Example *Example `thrift:"example,1" form:"example" json:"example" query:"example"` + Reference *Reference `thrift:"reference,2" form:"reference" json:"reference" query:"reference"` +} + +func NewExampleOrReference() *ExampleOrReference { + return &ExampleOrReference{} +} + +func (p *ExampleOrReference) InitDefault() { +} + +var ExampleOrReference_Example_DEFAULT *Example + +func (p *ExampleOrReference) GetExample() (v *Example) { + if !p.IsSetExample() { + return ExampleOrReference_Example_DEFAULT + } + return p.Example +} + +var ExampleOrReference_Reference_DEFAULT *Reference + +func (p *ExampleOrReference) GetReference() (v *Reference) { + if !p.IsSetReference() { + return ExampleOrReference_Reference_DEFAULT + } + return p.Reference +} + +var fieldIDToName_ExampleOrReference = map[int16]string{ + 1: "example", + 2: "reference", +} + +func (p *ExampleOrReference) IsSetExample() bool { + return p.Example != nil +} + +func (p *ExampleOrReference) IsSetReference() bool { + return p.Reference != nil +} + +func (p *ExampleOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ExampleOrReference) ReadField1(iprot thrift.TProtocol) error { + _field := NewExample() + if err := _field.Read(iprot); err != nil { + return err + } + p.Example = _field + return nil +} +func (p *ExampleOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Reference = _field + return nil +} + +func (p *ExampleOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ExampleOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *ExampleOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("example", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Example.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *ExampleOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Reference.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *ExampleOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ExampleOrReference(%+v)", *p) + +} + +type ExamplesOrReferences struct { + AdditionalProperties []*NamedExampleOrReference `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewExamplesOrReferences() *ExamplesOrReferences { + return &ExamplesOrReferences{} +} + +func (p *ExamplesOrReferences) InitDefault() { +} + +func (p *ExamplesOrReferences) GetAdditionalProperties() (v []*NamedExampleOrReference) { + return p.AdditionalProperties +} + +var fieldIDToName_ExamplesOrReferences = map[int16]string{ + 1: "additional_properties", +} + +func (p *ExamplesOrReferences) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExamplesOrReferences[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ExamplesOrReferences) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedExampleOrReference, 0, size) + values := make([]NamedExampleOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *ExamplesOrReferences) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ExamplesOrReferences"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *ExamplesOrReferences) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *ExamplesOrReferences) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ExamplesOrReferences(%+v)", *p) + +} + +type Expression struct { + AdditionalProperties []*NamedAny `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewExpression() *Expression { + return &Expression{} +} + +func (p *Expression) InitDefault() { +} + +func (p *Expression) GetAdditionalProperties() (v []*NamedAny) { + return p.AdditionalProperties +} + +var fieldIDToName_Expression = map[int16]string{ + 1: "additional_properties", +} + +func (p *Expression) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Expression[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Expression) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *Expression) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Expression"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Expression) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Expression) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Expression(%+v)", *p) + +} + +type ExternalDocs struct { + Description string `thrift:"description,1" form:"description" json:"description" query:"description"` + URL string `thrift:"url,2" form:"url" json:"url" query:"url"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,3" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewExternalDocs() *ExternalDocs { + return &ExternalDocs{} +} + +func (p *ExternalDocs) InitDefault() { +} + +func (p *ExternalDocs) GetDescription() (v string) { + return p.Description +} + +func (p *ExternalDocs) GetURL() (v string) { + return p.URL +} + +func (p *ExternalDocs) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_ExternalDocs = map[int16]string{ + 1: "description", + 2: "url", + 3: "specification_extension", +} + +func (p *ExternalDocs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.LIST { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExternalDocs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ExternalDocs) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *ExternalDocs) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.URL = _field + return nil +} +func (p *ExternalDocs) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *ExternalDocs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ExternalDocs"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *ExternalDocs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *ExternalDocs) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.URL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *ExternalDocs) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *ExternalDocs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ExternalDocs(%+v)", *p) + +} + +type Header struct { + Description string `thrift:"description,1" form:"description" json:"description" query:"description"` + Required bool `thrift:"required,2" form:"required" json:"required" query:"required"` + Deprecated bool `thrift:"deprecated,3" form:"deprecated" json:"deprecated" query:"deprecated"` + AllowEmptyValue bool `thrift:"allow_empty_value,4" form:"allow_empty_value" json:"allow_empty_value" query:"allow_empty_value"` + Style string `thrift:"style,5" form:"style" json:"style" query:"style"` + Explode bool `thrift:"explode,6" form:"explode" json:"explode" query:"explode"` + AllowReserved bool `thrift:"allow_reserved,7" form:"allow_reserved" json:"allow_reserved" query:"allow_reserved"` + Schema *SchemaOrReference `thrift:"schema,8" form:"schema" json:"schema" query:"schema"` + Example *Any `thrift:"example,9" form:"example" json:"example" query:"example"` + Examples *ExamplesOrReferences `thrift:"examples,10" form:"examples" json:"examples" query:"examples"` + Content *MediaTypes `thrift:"content,11" form:"content" json:"content" query:"content"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,12" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewHeader() *Header { + return &Header{} +} + +func (p *Header) InitDefault() { +} + +func (p *Header) GetDescription() (v string) { + return p.Description +} + +func (p *Header) GetRequired() (v bool) { + return p.Required +} + +func (p *Header) GetDeprecated() (v bool) { + return p.Deprecated +} + +func (p *Header) GetAllowEmptyValue() (v bool) { + return p.AllowEmptyValue +} + +func (p *Header) GetStyle() (v string) { + return p.Style +} + +func (p *Header) GetExplode() (v bool) { + return p.Explode +} + +func (p *Header) GetAllowReserved() (v bool) { + return p.AllowReserved +} + +var Header_Schema_DEFAULT *SchemaOrReference + +func (p *Header) GetSchema() (v *SchemaOrReference) { + if !p.IsSetSchema() { + return Header_Schema_DEFAULT + } + return p.Schema +} + +var Header_Example_DEFAULT *Any + +func (p *Header) GetExample() (v *Any) { + if !p.IsSetExample() { + return Header_Example_DEFAULT + } + return p.Example +} + +var Header_Examples_DEFAULT *ExamplesOrReferences + +func (p *Header) GetExamples() (v *ExamplesOrReferences) { + if !p.IsSetExamples() { + return Header_Examples_DEFAULT + } + return p.Examples +} + +var Header_Content_DEFAULT *MediaTypes + +func (p *Header) GetContent() (v *MediaTypes) { + if !p.IsSetContent() { + return Header_Content_DEFAULT + } + return p.Content +} + +func (p *Header) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Header = map[int16]string{ + 1: "description", + 2: "required", + 3: "deprecated", + 4: "allow_empty_value", + 5: "style", + 6: "explode", + 7: "allow_reserved", + 8: "schema", + 9: "example", + 10: "examples", + 11: "content", + 12: "specification_extension", +} + +func (p *Header) IsSetSchema() bool { + return p.Schema != nil +} + +func (p *Header) IsSetExample() bool { + return p.Example != nil +} + +func (p *Header) IsSetExamples() bool { + return p.Examples != nil +} + +func (p *Header) IsSetContent() bool { + return p.Content != nil +} + +func (p *Header) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.LIST { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Header[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Header) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *Header) ReadField2(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Required = _field + return nil +} +func (p *Header) ReadField3(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Deprecated = _field + return nil +} +func (p *Header) ReadField4(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.AllowEmptyValue = _field + return nil +} +func (p *Header) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Style = _field + return nil +} +func (p *Header) ReadField6(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Explode = _field + return nil +} +func (p *Header) ReadField7(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.AllowReserved = _field + return nil +} +func (p *Header) ReadField8(iprot thrift.TProtocol) error { + _field := NewSchemaOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Schema = _field + return nil +} +func (p *Header) ReadField9(iprot thrift.TProtocol) error { + _field := NewAny() + if err := _field.Read(iprot); err != nil { + return err + } + p.Example = _field + return nil +} +func (p *Header) ReadField10(iprot thrift.TProtocol) error { + _field := NewExamplesOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.Examples = _field + return nil +} +func (p *Header) ReadField11(iprot thrift.TProtocol) error { + _field := NewMediaTypes() + if err := _field.Read(iprot); err != nil { + return err + } + p.Content = _field + return nil +} +func (p *Header) ReadField12(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Header) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Header"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Header) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Header) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("required", thrift.BOOL, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Required); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Header) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("deprecated", thrift.BOOL, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Deprecated); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Header) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("allow_empty_value", thrift.BOOL, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.AllowEmptyValue); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Header) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("style", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Style); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Header) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("explode", thrift.BOOL, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Explode); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *Header) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("allow_reserved", thrift.BOOL, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.AllowReserved); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *Header) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("schema", thrift.STRUCT, 8); err != nil { + goto WriteFieldBeginError + } + if err := p.Schema.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *Header) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("example", thrift.STRUCT, 9); err != nil { + goto WriteFieldBeginError + } + if err := p.Example.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *Header) writeField10(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("examples", thrift.STRUCT, 10); err != nil { + goto WriteFieldBeginError + } + if err := p.Examples.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *Header) writeField11(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("content", thrift.STRUCT, 11); err != nil { + goto WriteFieldBeginError + } + if err := p.Content.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + +func (p *Header) writeField12(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *Header) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Header(%+v)", *p) + +} + +type HeaderOrReference struct { + Header *Header `thrift:"header,1" form:"header" json:"header" query:"header"` + Reference *Reference `thrift:"reference,2" form:"reference" json:"reference" query:"reference"` +} + +func NewHeaderOrReference() *HeaderOrReference { + return &HeaderOrReference{} +} + +func (p *HeaderOrReference) InitDefault() { +} + +var HeaderOrReference_Header_DEFAULT *Header + +func (p *HeaderOrReference) GetHeader() (v *Header) { + if !p.IsSetHeader() { + return HeaderOrReference_Header_DEFAULT + } + return p.Header +} + +var HeaderOrReference_Reference_DEFAULT *Reference + +func (p *HeaderOrReference) GetReference() (v *Reference) { + if !p.IsSetReference() { + return HeaderOrReference_Reference_DEFAULT + } + return p.Reference +} + +var fieldIDToName_HeaderOrReference = map[int16]string{ + 1: "header", + 2: "reference", +} + +func (p *HeaderOrReference) IsSetHeader() bool { + return p.Header != nil +} + +func (p *HeaderOrReference) IsSetReference() bool { + return p.Reference != nil +} + +func (p *HeaderOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_HeaderOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *HeaderOrReference) ReadField1(iprot thrift.TProtocol) error { + _field := NewHeader() + if err := _field.Read(iprot); err != nil { + return err + } + p.Header = _field + return nil +} +func (p *HeaderOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Reference = _field + return nil +} + +func (p *HeaderOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("HeaderOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *HeaderOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("header", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Header.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *HeaderOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Reference.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *HeaderOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HeaderOrReference(%+v)", *p) + +} + +type HeadersOrReferences struct { + AdditionalProperties []*NamedHeaderOrReference `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewHeadersOrReferences() *HeadersOrReferences { + return &HeadersOrReferences{} +} + +func (p *HeadersOrReferences) InitDefault() { +} + +func (p *HeadersOrReferences) GetAdditionalProperties() (v []*NamedHeaderOrReference) { + return p.AdditionalProperties +} + +var fieldIDToName_HeadersOrReferences = map[int16]string{ + 1: "additional_properties", +} + +func (p *HeadersOrReferences) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_HeadersOrReferences[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *HeadersOrReferences) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedHeaderOrReference, 0, size) + values := make([]NamedHeaderOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *HeadersOrReferences) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("HeadersOrReferences"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *HeadersOrReferences) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *HeadersOrReferences) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HeadersOrReferences(%+v)", *p) + +} + +type Info struct { + Title string `thrift:"title,1" form:"title" json:"title" query:"title"` + Description string `thrift:"description,2" form:"description" json:"description" query:"description"` + TermsOfService string `thrift:"terms_of_service,3" form:"terms_of_service" json:"terms_of_service" query:"terms_of_service"` + Contact *Contact `thrift:"contact,4" form:"contact" json:"contact" query:"contact"` + License *License `thrift:"license,5" form:"license" json:"license" query:"license"` + Version string `thrift:"version,6" form:"version" json:"version" query:"version"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,7" form:"specification_extension" json:"specification_extension" query:"specification_extension"` + Summary string `thrift:"summary,8" form:"summary" json:"summary" query:"summary"` +} + +func NewInfo() *Info { + return &Info{} +} + +func (p *Info) InitDefault() { +} + +func (p *Info) GetTitle() (v string) { + return p.Title +} + +func (p *Info) GetDescription() (v string) { + return p.Description +} + +func (p *Info) GetTermsOfService() (v string) { + return p.TermsOfService +} + +var Info_Contact_DEFAULT *Contact + +func (p *Info) GetContact() (v *Contact) { + if !p.IsSetContact() { + return Info_Contact_DEFAULT + } + return p.Contact +} + +var Info_License_DEFAULT *License + +func (p *Info) GetLicense() (v *License) { + if !p.IsSetLicense() { + return Info_License_DEFAULT + } + return p.License +} + +func (p *Info) GetVersion() (v string) { + return p.Version +} + +func (p *Info) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +func (p *Info) GetSummary() (v string) { + return p.Summary +} + +var fieldIDToName_Info = map[int16]string{ + 1: "title", + 2: "description", + 3: "terms_of_service", + 4: "contact", + 5: "license", + 6: "version", + 7: "specification_extension", + 8: "summary", +} + +func (p *Info) IsSetContact() bool { + return p.Contact != nil +} + +func (p *Info) IsSetLicense() bool { + return p.License != nil +} + +func (p *Info) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRING { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.LIST { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.STRING { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Info[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Info) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Title = _field + return nil +} +func (p *Info) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *Info) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.TermsOfService = _field + return nil +} +func (p *Info) ReadField4(iprot thrift.TProtocol) error { + _field := NewContact() + if err := _field.Read(iprot); err != nil { + return err + } + p.Contact = _field + return nil +} +func (p *Info) ReadField5(iprot thrift.TProtocol) error { + _field := NewLicense() + if err := _field.Read(iprot); err != nil { + return err + } + p.License = _field + return nil +} +func (p *Info) ReadField6(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Version = _field + return nil +} +func (p *Info) ReadField7(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} +func (p *Info) ReadField8(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Summary = _field + return nil +} + +func (p *Info) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Info"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Info) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("title", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Title); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Info) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Info) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("terms_of_service", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.TermsOfService); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Info) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("contact", thrift.STRUCT, 4); err != nil { + goto WriteFieldBeginError + } + if err := p.Contact.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Info) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("license", thrift.STRUCT, 5); err != nil { + goto WriteFieldBeginError + } + if err := p.License.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Info) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Version); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *Info) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *Info) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("summary", thrift.STRING, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Summary); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *Info) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Info(%+v)", *p) + +} + +type ItemsItem struct { + SchemaOrReference []*SchemaOrReference `thrift:"schema_or_reference,1" form:"schema_or_reference" json:"schema_or_reference" query:"schema_or_reference"` +} + +func NewItemsItem() *ItemsItem { + return &ItemsItem{} +} + +func (p *ItemsItem) InitDefault() { +} + +func (p *ItemsItem) GetSchemaOrReference() (v []*SchemaOrReference) { + return p.SchemaOrReference +} + +var fieldIDToName_ItemsItem = map[int16]string{ + 1: "schema_or_reference", +} + +func (p *ItemsItem) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ItemsItem[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ItemsItem) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*SchemaOrReference, 0, size) + values := make([]SchemaOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SchemaOrReference = _field + return nil +} + +func (p *ItemsItem) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ItemsItem"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *ItemsItem) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("schema_or_reference", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SchemaOrReference)); err != nil { + return err + } + for _, v := range p.SchemaOrReference { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *ItemsItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ItemsItem(%+v)", *p) + +} + +type License struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + URL string `thrift:"url,2" form:"url" json:"url" query:"url"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,3" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewLicense() *License { + return &License{} +} + +func (p *License) InitDefault() { +} + +func (p *License) GetName() (v string) { + return p.Name +} + +func (p *License) GetURL() (v string) { + return p.URL +} + +func (p *License) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_License = map[int16]string{ + 1: "name", + 2: "url", + 3: "specification_extension", +} + +func (p *License) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.LIST { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_License[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *License) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *License) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.URL = _field + return nil +} +func (p *License) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *License) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("License"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *License) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *License) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.URL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *License) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *License) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("License(%+v)", *p) + +} + +type Link struct { + OperationRef string `thrift:"operation_ref,1" form:"operation_ref" json:"operation_ref" query:"operation_ref"` + OperationID string `thrift:"operation_id,2" form:"operation_id" json:"operation_id" query:"operation_id"` + Parameters *AnyOrExpression `thrift:"parameters,3" form:"parameters" json:"parameters" query:"parameters"` + RequestBody *AnyOrExpression `thrift:"request_body,4" form:"request_body" json:"request_body" query:"request_body"` + Description string `thrift:"description,5" form:"description" json:"description" query:"description"` + Server *Server `thrift:"server,6" form:"server" json:"server" query:"server"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,7" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewLink() *Link { + return &Link{} +} + +func (p *Link) InitDefault() { +} + +func (p *Link) GetOperationRef() (v string) { + return p.OperationRef +} + +func (p *Link) GetOperationID() (v string) { + return p.OperationID +} + +var Link_Parameters_DEFAULT *AnyOrExpression + +func (p *Link) GetParameters() (v *AnyOrExpression) { + if !p.IsSetParameters() { + return Link_Parameters_DEFAULT + } + return p.Parameters +} + +var Link_RequestBody_DEFAULT *AnyOrExpression + +func (p *Link) GetRequestBody() (v *AnyOrExpression) { + if !p.IsSetRequestBody() { + return Link_RequestBody_DEFAULT + } + return p.RequestBody +} + +func (p *Link) GetDescription() (v string) { + return p.Description +} + +var Link_Server_DEFAULT *Server + +func (p *Link) GetServer() (v *Server) { + if !p.IsSetServer() { + return Link_Server_DEFAULT + } + return p.Server +} + +func (p *Link) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Link = map[int16]string{ + 1: "operation_ref", + 2: "operation_id", + 3: "parameters", + 4: "request_body", + 5: "description", + 6: "server", + 7: "specification_extension", +} + +func (p *Link) IsSetParameters() bool { + return p.Parameters != nil +} + +func (p *Link) IsSetRequestBody() bool { + return p.RequestBody != nil +} + +func (p *Link) IsSetServer() bool { + return p.Server != nil +} + +func (p *Link) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.LIST { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Link[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Link) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.OperationRef = _field + return nil +} +func (p *Link) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.OperationID = _field + return nil +} +func (p *Link) ReadField3(iprot thrift.TProtocol) error { + _field := NewAnyOrExpression() + if err := _field.Read(iprot); err != nil { + return err + } + p.Parameters = _field + return nil +} +func (p *Link) ReadField4(iprot thrift.TProtocol) error { + _field := NewAnyOrExpression() + if err := _field.Read(iprot); err != nil { + return err + } + p.RequestBody = _field + return nil +} +func (p *Link) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *Link) ReadField6(iprot thrift.TProtocol) error { + _field := NewServer() + if err := _field.Read(iprot); err != nil { + return err + } + p.Server = _field + return nil +} +func (p *Link) ReadField7(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Link) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Link"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Link) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("operation_ref", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.OperationRef); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Link) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("operation_id", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.OperationID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Link) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("parameters", thrift.STRUCT, 3); err != nil { + goto WriteFieldBeginError + } + if err := p.Parameters.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Link) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request_body", thrift.STRUCT, 4); err != nil { + goto WriteFieldBeginError + } + if err := p.RequestBody.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Link) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Link) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("server", thrift.STRUCT, 6); err != nil { + goto WriteFieldBeginError + } + if err := p.Server.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *Link) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *Link) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Link(%+v)", *p) + +} + +type LinkOrReference struct { + Link *Link `thrift:"link,1" form:"link" json:"link" query:"link"` + Reference *Reference `thrift:"reference,2" form:"reference" json:"reference" query:"reference"` +} + +func NewLinkOrReference() *LinkOrReference { + return &LinkOrReference{} +} + +func (p *LinkOrReference) InitDefault() { +} + +var LinkOrReference_Link_DEFAULT *Link + +func (p *LinkOrReference) GetLink() (v *Link) { + if !p.IsSetLink() { + return LinkOrReference_Link_DEFAULT + } + return p.Link +} + +var LinkOrReference_Reference_DEFAULT *Reference + +func (p *LinkOrReference) GetReference() (v *Reference) { + if !p.IsSetReference() { + return LinkOrReference_Reference_DEFAULT + } + return p.Reference +} + +var fieldIDToName_LinkOrReference = map[int16]string{ + 1: "link", + 2: "reference", +} + +func (p *LinkOrReference) IsSetLink() bool { + return p.Link != nil +} + +func (p *LinkOrReference) IsSetReference() bool { + return p.Reference != nil +} + +func (p *LinkOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LinkOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LinkOrReference) ReadField1(iprot thrift.TProtocol) error { + _field := NewLink() + if err := _field.Read(iprot); err != nil { + return err + } + p.Link = _field + return nil +} +func (p *LinkOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Reference = _field + return nil +} + +func (p *LinkOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("LinkOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *LinkOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("link", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Link.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *LinkOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Reference.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *LinkOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LinkOrReference(%+v)", *p) + +} + +type LinksOrReferences struct { + AdditionalProperties []*NamedLinkOrReference `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewLinksOrReferences() *LinksOrReferences { + return &LinksOrReferences{} +} + +func (p *LinksOrReferences) InitDefault() { +} + +func (p *LinksOrReferences) GetAdditionalProperties() (v []*NamedLinkOrReference) { + return p.AdditionalProperties +} + +var fieldIDToName_LinksOrReferences = map[int16]string{ + 1: "additional_properties", +} + +func (p *LinksOrReferences) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LinksOrReferences[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LinksOrReferences) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedLinkOrReference, 0, size) + values := make([]NamedLinkOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *LinksOrReferences) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("LinksOrReferences"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *LinksOrReferences) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *LinksOrReferences) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LinksOrReferences(%+v)", *p) + +} + +type MediaType struct { + Schema *SchemaOrReference `thrift:"schema,1" form:"schema" json:"schema" query:"schema"` + Example *Any `thrift:"example,2" form:"example" json:"example" query:"example"` + Examples *ExamplesOrReferences `thrift:"examples,3" form:"examples" json:"examples" query:"examples"` + Encoding *Encodings `thrift:"encoding,4" form:"encoding" json:"encoding" query:"encoding"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,5" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewMediaType() *MediaType { + return &MediaType{} +} + +func (p *MediaType) InitDefault() { +} + +var MediaType_Schema_DEFAULT *SchemaOrReference + +func (p *MediaType) GetSchema() (v *SchemaOrReference) { + if !p.IsSetSchema() { + return MediaType_Schema_DEFAULT + } + return p.Schema +} + +var MediaType_Example_DEFAULT *Any + +func (p *MediaType) GetExample() (v *Any) { + if !p.IsSetExample() { + return MediaType_Example_DEFAULT + } + return p.Example +} + +var MediaType_Examples_DEFAULT *ExamplesOrReferences + +func (p *MediaType) GetExamples() (v *ExamplesOrReferences) { + if !p.IsSetExamples() { + return MediaType_Examples_DEFAULT + } + return p.Examples +} + +var MediaType_Encoding_DEFAULT *Encodings + +func (p *MediaType) GetEncoding() (v *Encodings) { + if !p.IsSetEncoding() { + return MediaType_Encoding_DEFAULT + } + return p.Encoding +} + +func (p *MediaType) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_MediaType = map[int16]string{ + 1: "schema", + 2: "example", + 3: "examples", + 4: "encoding", + 5: "specification_extension", +} + +func (p *MediaType) IsSetSchema() bool { + return p.Schema != nil +} + +func (p *MediaType) IsSetExample() bool { + return p.Example != nil +} + +func (p *MediaType) IsSetExamples() bool { + return p.Examples != nil +} + +func (p *MediaType) IsSetEncoding() bool { + return p.Encoding != nil +} + +func (p *MediaType) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.LIST { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MediaType[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *MediaType) ReadField1(iprot thrift.TProtocol) error { + _field := NewSchemaOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Schema = _field + return nil +} +func (p *MediaType) ReadField2(iprot thrift.TProtocol) error { + _field := NewAny() + if err := _field.Read(iprot); err != nil { + return err + } + p.Example = _field + return nil +} +func (p *MediaType) ReadField3(iprot thrift.TProtocol) error { + _field := NewExamplesOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.Examples = _field + return nil +} +func (p *MediaType) ReadField4(iprot thrift.TProtocol) error { + _field := NewEncodings() + if err := _field.Read(iprot); err != nil { + return err + } + p.Encoding = _field + return nil +} +func (p *MediaType) ReadField5(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *MediaType) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("MediaType"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *MediaType) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("schema", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Schema.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *MediaType) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("example", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Example.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *MediaType) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("examples", thrift.STRUCT, 3); err != nil { + goto WriteFieldBeginError + } + if err := p.Examples.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *MediaType) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("encoding", thrift.STRUCT, 4); err != nil { + goto WriteFieldBeginError + } + if err := p.Encoding.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *MediaType) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *MediaType) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MediaType(%+v)", *p) + +} + +type MediaTypes struct { + AdditionalProperties []*NamedMediaType `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewMediaTypes() *MediaTypes { + return &MediaTypes{} +} + +func (p *MediaTypes) InitDefault() { +} + +func (p *MediaTypes) GetAdditionalProperties() (v []*NamedMediaType) { + return p.AdditionalProperties +} + +var fieldIDToName_MediaTypes = map[int16]string{ + 1: "additional_properties", +} + +func (p *MediaTypes) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MediaTypes[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *MediaTypes) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedMediaType, 0, size) + values := make([]NamedMediaType, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *MediaTypes) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("MediaTypes"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *MediaTypes) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *MediaTypes) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MediaTypes(%+v)", *p) + +} + +type NamedAny struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *Any `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedAny() *NamedAny { + return &NamedAny{} +} + +func (p *NamedAny) InitDefault() { +} + +func (p *NamedAny) GetName() (v string) { + return p.Name +} + +var NamedAny_Value_DEFAULT *Any + +func (p *NamedAny) GetValue() (v *Any) { + if !p.IsSetValue() { + return NamedAny_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedAny = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedAny) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedAny) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedAny[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedAny) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedAny) ReadField2(iprot thrift.TProtocol) error { + _field := NewAny() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedAny) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedAny"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedAny) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedAny) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedAny) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedAny(%+v)", *p) + +} + +type NamedCallbackOrReference struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *CallbackOrReference `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedCallbackOrReference() *NamedCallbackOrReference { + return &NamedCallbackOrReference{} +} + +func (p *NamedCallbackOrReference) InitDefault() { +} + +func (p *NamedCallbackOrReference) GetName() (v string) { + return p.Name +} + +var NamedCallbackOrReference_Value_DEFAULT *CallbackOrReference + +func (p *NamedCallbackOrReference) GetValue() (v *CallbackOrReference) { + if !p.IsSetValue() { + return NamedCallbackOrReference_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedCallbackOrReference = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedCallbackOrReference) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedCallbackOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedCallbackOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedCallbackOrReference) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedCallbackOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewCallbackOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedCallbackOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedCallbackOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedCallbackOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedCallbackOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedCallbackOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedCallbackOrReference(%+v)", *p) + +} + +type NamedEncoding struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *Encoding `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedEncoding() *NamedEncoding { + return &NamedEncoding{} +} + +func (p *NamedEncoding) InitDefault() { +} + +func (p *NamedEncoding) GetName() (v string) { + return p.Name +} + +var NamedEncoding_Value_DEFAULT *Encoding + +func (p *NamedEncoding) GetValue() (v *Encoding) { + if !p.IsSetValue() { + return NamedEncoding_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedEncoding = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedEncoding) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedEncoding) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedEncoding[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedEncoding) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedEncoding) ReadField2(iprot thrift.TProtocol) error { + _field := NewEncoding() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedEncoding) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedEncoding"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedEncoding) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedEncoding) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedEncoding) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedEncoding(%+v)", *p) + +} + +type NamedExampleOrReference struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *ExampleOrReference `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedExampleOrReference() *NamedExampleOrReference { + return &NamedExampleOrReference{} +} + +func (p *NamedExampleOrReference) InitDefault() { +} + +func (p *NamedExampleOrReference) GetName() (v string) { + return p.Name +} + +var NamedExampleOrReference_Value_DEFAULT *ExampleOrReference + +func (p *NamedExampleOrReference) GetValue() (v *ExampleOrReference) { + if !p.IsSetValue() { + return NamedExampleOrReference_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedExampleOrReference = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedExampleOrReference) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedExampleOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedExampleOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedExampleOrReference) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedExampleOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewExampleOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedExampleOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedExampleOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedExampleOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedExampleOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedExampleOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedExampleOrReference(%+v)", *p) + +} + +type NamedHeaderOrReference struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *HeaderOrReference `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedHeaderOrReference() *NamedHeaderOrReference { + return &NamedHeaderOrReference{} +} + +func (p *NamedHeaderOrReference) InitDefault() { +} + +func (p *NamedHeaderOrReference) GetName() (v string) { + return p.Name +} + +var NamedHeaderOrReference_Value_DEFAULT *HeaderOrReference + +func (p *NamedHeaderOrReference) GetValue() (v *HeaderOrReference) { + if !p.IsSetValue() { + return NamedHeaderOrReference_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedHeaderOrReference = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedHeaderOrReference) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedHeaderOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedHeaderOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedHeaderOrReference) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedHeaderOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewHeaderOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedHeaderOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedHeaderOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedHeaderOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedHeaderOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedHeaderOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedHeaderOrReference(%+v)", *p) + +} + +type NamedLinkOrReference struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *LinkOrReference `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedLinkOrReference() *NamedLinkOrReference { + return &NamedLinkOrReference{} +} + +func (p *NamedLinkOrReference) InitDefault() { +} + +func (p *NamedLinkOrReference) GetName() (v string) { + return p.Name +} + +var NamedLinkOrReference_Value_DEFAULT *LinkOrReference + +func (p *NamedLinkOrReference) GetValue() (v *LinkOrReference) { + if !p.IsSetValue() { + return NamedLinkOrReference_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedLinkOrReference = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedLinkOrReference) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedLinkOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedLinkOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedLinkOrReference) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedLinkOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewLinkOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedLinkOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedLinkOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedLinkOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedLinkOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedLinkOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedLinkOrReference(%+v)", *p) + +} + +type NamedMediaType struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *MediaType `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedMediaType() *NamedMediaType { + return &NamedMediaType{} +} + +func (p *NamedMediaType) InitDefault() { +} + +func (p *NamedMediaType) GetName() (v string) { + return p.Name +} + +var NamedMediaType_Value_DEFAULT *MediaType + +func (p *NamedMediaType) GetValue() (v *MediaType) { + if !p.IsSetValue() { + return NamedMediaType_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedMediaType = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedMediaType) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedMediaType) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedMediaType[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedMediaType) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedMediaType) ReadField2(iprot thrift.TProtocol) error { + _field := NewMediaType() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedMediaType) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedMediaType"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedMediaType) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedMediaType) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedMediaType) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedMediaType(%+v)", *p) + +} + +type NamedParameterOrReference struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *ParameterOrReference `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedParameterOrReference() *NamedParameterOrReference { + return &NamedParameterOrReference{} +} + +func (p *NamedParameterOrReference) InitDefault() { +} + +func (p *NamedParameterOrReference) GetName() (v string) { + return p.Name +} + +var NamedParameterOrReference_Value_DEFAULT *ParameterOrReference + +func (p *NamedParameterOrReference) GetValue() (v *ParameterOrReference) { + if !p.IsSetValue() { + return NamedParameterOrReference_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedParameterOrReference = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedParameterOrReference) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedParameterOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedParameterOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedParameterOrReference) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedParameterOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewParameterOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedParameterOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedParameterOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedParameterOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedParameterOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedParameterOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedParameterOrReference(%+v)", *p) + +} + +type NamedPathItem struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *PathItem `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedPathItem() *NamedPathItem { + return &NamedPathItem{} +} + +func (p *NamedPathItem) InitDefault() { +} + +func (p *NamedPathItem) GetName() (v string) { + return p.Name +} + +var NamedPathItem_Value_DEFAULT *PathItem + +func (p *NamedPathItem) GetValue() (v *PathItem) { + if !p.IsSetValue() { + return NamedPathItem_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedPathItem = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedPathItem) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedPathItem) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedPathItem[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedPathItem) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedPathItem) ReadField2(iprot thrift.TProtocol) error { + _field := NewPathItem() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedPathItem) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedPathItem"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedPathItem) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedPathItem) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedPathItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedPathItem(%+v)", *p) + +} + +type NamedRequestBodyOrReference struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *RequestBodyOrReference `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedRequestBodyOrReference() *NamedRequestBodyOrReference { + return &NamedRequestBodyOrReference{} +} + +func (p *NamedRequestBodyOrReference) InitDefault() { +} + +func (p *NamedRequestBodyOrReference) GetName() (v string) { + return p.Name +} + +var NamedRequestBodyOrReference_Value_DEFAULT *RequestBodyOrReference + +func (p *NamedRequestBodyOrReference) GetValue() (v *RequestBodyOrReference) { + if !p.IsSetValue() { + return NamedRequestBodyOrReference_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedRequestBodyOrReference = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedRequestBodyOrReference) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedRequestBodyOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedRequestBodyOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedRequestBodyOrReference) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedRequestBodyOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewRequestBodyOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedRequestBodyOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedRequestBodyOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedRequestBodyOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedRequestBodyOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedRequestBodyOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedRequestBodyOrReference(%+v)", *p) + +} + +type NamedResponseOrReference struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *ResponseOrReference `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedResponseOrReference() *NamedResponseOrReference { + return &NamedResponseOrReference{} +} + +func (p *NamedResponseOrReference) InitDefault() { +} + +func (p *NamedResponseOrReference) GetName() (v string) { + return p.Name +} + +var NamedResponseOrReference_Value_DEFAULT *ResponseOrReference + +func (p *NamedResponseOrReference) GetValue() (v *ResponseOrReference) { + if !p.IsSetValue() { + return NamedResponseOrReference_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedResponseOrReference = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedResponseOrReference) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedResponseOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedResponseOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedResponseOrReference) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedResponseOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewResponseOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedResponseOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedResponseOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedResponseOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedResponseOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedResponseOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedResponseOrReference(%+v)", *p) + +} + +type NamedSchemaOrReference struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *SchemaOrReference `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedSchemaOrReference() *NamedSchemaOrReference { + return &NamedSchemaOrReference{} +} + +func (p *NamedSchemaOrReference) InitDefault() { +} + +func (p *NamedSchemaOrReference) GetName() (v string) { + return p.Name +} + +var NamedSchemaOrReference_Value_DEFAULT *SchemaOrReference + +func (p *NamedSchemaOrReference) GetValue() (v *SchemaOrReference) { + if !p.IsSetValue() { + return NamedSchemaOrReference_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedSchemaOrReference = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedSchemaOrReference) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedSchemaOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedSchemaOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedSchemaOrReference) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedSchemaOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewSchemaOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedSchemaOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedSchemaOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedSchemaOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedSchemaOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedSchemaOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedSchemaOrReference(%+v)", *p) + +} + +type NamedSecuritySchemeOrReference struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *SecuritySchemeOrReference `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedSecuritySchemeOrReference() *NamedSecuritySchemeOrReference { + return &NamedSecuritySchemeOrReference{} +} + +func (p *NamedSecuritySchemeOrReference) InitDefault() { +} + +func (p *NamedSecuritySchemeOrReference) GetName() (v string) { + return p.Name +} + +var NamedSecuritySchemeOrReference_Value_DEFAULT *SecuritySchemeOrReference + +func (p *NamedSecuritySchemeOrReference) GetValue() (v *SecuritySchemeOrReference) { + if !p.IsSetValue() { + return NamedSecuritySchemeOrReference_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedSecuritySchemeOrReference = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedSecuritySchemeOrReference) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedSecuritySchemeOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedSecuritySchemeOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedSecuritySchemeOrReference) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedSecuritySchemeOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewSecuritySchemeOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedSecuritySchemeOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedSecuritySchemeOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedSecuritySchemeOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedSecuritySchemeOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedSecuritySchemeOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedSecuritySchemeOrReference(%+v)", *p) + +} + +type NamedServerVariable struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *ServerVariable `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedServerVariable() *NamedServerVariable { + return &NamedServerVariable{} +} + +func (p *NamedServerVariable) InitDefault() { +} + +func (p *NamedServerVariable) GetName() (v string) { + return p.Name +} + +var NamedServerVariable_Value_DEFAULT *ServerVariable + +func (p *NamedServerVariable) GetValue() (v *ServerVariable) { + if !p.IsSetValue() { + return NamedServerVariable_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedServerVariable = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedServerVariable) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedServerVariable) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedServerVariable[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedServerVariable) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedServerVariable) ReadField2(iprot thrift.TProtocol) error { + _field := NewServerVariable() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedServerVariable) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedServerVariable"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedServerVariable) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedServerVariable) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedServerVariable) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedServerVariable(%+v)", *p) + +} + +type NamedString struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value string `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedString() *NamedString { + return &NamedString{} +} + +func (p *NamedString) InitDefault() { +} + +func (p *NamedString) GetName() (v string) { + return p.Name +} + +func (p *NamedString) GetValue() (v string) { + return p.Value +} + +var fieldIDToName_NamedString = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedString) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedString[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedString) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedString) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Value = _field + return nil +} + +func (p *NamedString) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedString"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedString) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedString) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Value); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedString) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedString(%+v)", *p) + +} + +type NamedStringArray struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Value *StringArray `thrift:"value,2" form:"value" json:"value" query:"value"` +} + +func NewNamedStringArray() *NamedStringArray { + return &NamedStringArray{} +} + +func (p *NamedStringArray) InitDefault() { +} + +func (p *NamedStringArray) GetName() (v string) { + return p.Name +} + +var NamedStringArray_Value_DEFAULT *StringArray + +func (p *NamedStringArray) GetValue() (v *StringArray) { + if !p.IsSetValue() { + return NamedStringArray_Value_DEFAULT + } + return p.Value +} + +var fieldIDToName_NamedStringArray = map[int16]string{ + 1: "name", + 2: "value", +} + +func (p *NamedStringArray) IsSetValue() bool { + return p.Value != nil +} + +func (p *NamedStringArray) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedStringArray[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *NamedStringArray) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *NamedStringArray) ReadField2(iprot thrift.TProtocol) error { + _field := NewStringArray() + if err := _field.Read(iprot); err != nil { + return err + } + p.Value = _field + return nil +} + +func (p *NamedStringArray) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("NamedStringArray"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *NamedStringArray) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *NamedStringArray) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Value.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *NamedStringArray) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NamedStringArray(%+v)", *p) + +} + +type OauthFlow struct { + AuthorizationURL string `thrift:"authorization_url,1" form:"authorization_url" json:"authorization_url" query:"authorization_url"` + TokenURL string `thrift:"token_url,2" form:"token_url" json:"token_url" query:"token_url"` + RefreshURL string `thrift:"refresh_url,3" form:"refresh_url" json:"refresh_url" query:"refresh_url"` + Scopes *Strings `thrift:"scopes,4" form:"scopes" json:"scopes" query:"scopes"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,5" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewOauthFlow() *OauthFlow { + return &OauthFlow{} +} + +func (p *OauthFlow) InitDefault() { +} + +func (p *OauthFlow) GetAuthorizationURL() (v string) { + return p.AuthorizationURL +} + +func (p *OauthFlow) GetTokenURL() (v string) { + return p.TokenURL +} + +func (p *OauthFlow) GetRefreshURL() (v string) { + return p.RefreshURL +} + +var OauthFlow_Scopes_DEFAULT *Strings + +func (p *OauthFlow) GetScopes() (v *Strings) { + if !p.IsSetScopes() { + return OauthFlow_Scopes_DEFAULT + } + return p.Scopes +} + +func (p *OauthFlow) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_OauthFlow = map[int16]string{ + 1: "authorization_url", + 2: "token_url", + 3: "refresh_url", + 4: "scopes", + 5: "specification_extension", +} + +func (p *OauthFlow) IsSetScopes() bool { + return p.Scopes != nil +} + +func (p *OauthFlow) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.LIST { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_OauthFlow[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *OauthFlow) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.AuthorizationURL = _field + return nil +} +func (p *OauthFlow) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.TokenURL = _field + return nil +} +func (p *OauthFlow) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.RefreshURL = _field + return nil +} +func (p *OauthFlow) ReadField4(iprot thrift.TProtocol) error { + _field := NewStrings() + if err := _field.Read(iprot); err != nil { + return err + } + p.Scopes = _field + return nil +} +func (p *OauthFlow) ReadField5(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *OauthFlow) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("OauthFlow"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *OauthFlow) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("authorization_url", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.AuthorizationURL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *OauthFlow) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("token_url", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.TokenURL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *OauthFlow) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("refresh_url", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.RefreshURL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *OauthFlow) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("scopes", thrift.STRUCT, 4); err != nil { + goto WriteFieldBeginError + } + if err := p.Scopes.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *OauthFlow) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *OauthFlow) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("OauthFlow(%+v)", *p) + +} + +type OauthFlows struct { + Implicit *OauthFlow `thrift:"implicit,1" form:"implicit" json:"implicit" query:"implicit"` + Password *OauthFlow `thrift:"password,2" form:"password" json:"password" query:"password"` + ClientCredentials *OauthFlow `thrift:"client_credentials,3" form:"client_credentials" json:"client_credentials" query:"client_credentials"` + AuthorizationCode *OauthFlow `thrift:"authorization_code,4" form:"authorization_code" json:"authorization_code" query:"authorization_code"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,5" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewOauthFlows() *OauthFlows { + return &OauthFlows{} +} + +func (p *OauthFlows) InitDefault() { +} + +var OauthFlows_Implicit_DEFAULT *OauthFlow + +func (p *OauthFlows) GetImplicit() (v *OauthFlow) { + if !p.IsSetImplicit() { + return OauthFlows_Implicit_DEFAULT + } + return p.Implicit +} + +var OauthFlows_Password_DEFAULT *OauthFlow + +func (p *OauthFlows) GetPassword() (v *OauthFlow) { + if !p.IsSetPassword() { + return OauthFlows_Password_DEFAULT + } + return p.Password +} + +var OauthFlows_ClientCredentials_DEFAULT *OauthFlow + +func (p *OauthFlows) GetClientCredentials() (v *OauthFlow) { + if !p.IsSetClientCredentials() { + return OauthFlows_ClientCredentials_DEFAULT + } + return p.ClientCredentials +} + +var OauthFlows_AuthorizationCode_DEFAULT *OauthFlow + +func (p *OauthFlows) GetAuthorizationCode() (v *OauthFlow) { + if !p.IsSetAuthorizationCode() { + return OauthFlows_AuthorizationCode_DEFAULT + } + return p.AuthorizationCode +} + +func (p *OauthFlows) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_OauthFlows = map[int16]string{ + 1: "implicit", + 2: "password", + 3: "client_credentials", + 4: "authorization_code", + 5: "specification_extension", +} + +func (p *OauthFlows) IsSetImplicit() bool { + return p.Implicit != nil +} + +func (p *OauthFlows) IsSetPassword() bool { + return p.Password != nil +} + +func (p *OauthFlows) IsSetClientCredentials() bool { + return p.ClientCredentials != nil +} + +func (p *OauthFlows) IsSetAuthorizationCode() bool { + return p.AuthorizationCode != nil +} + +func (p *OauthFlows) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.LIST { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_OauthFlows[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *OauthFlows) ReadField1(iprot thrift.TProtocol) error { + _field := NewOauthFlow() + if err := _field.Read(iprot); err != nil { + return err + } + p.Implicit = _field + return nil +} +func (p *OauthFlows) ReadField2(iprot thrift.TProtocol) error { + _field := NewOauthFlow() + if err := _field.Read(iprot); err != nil { + return err + } + p.Password = _field + return nil +} +func (p *OauthFlows) ReadField3(iprot thrift.TProtocol) error { + _field := NewOauthFlow() + if err := _field.Read(iprot); err != nil { + return err + } + p.ClientCredentials = _field + return nil +} +func (p *OauthFlows) ReadField4(iprot thrift.TProtocol) error { + _field := NewOauthFlow() + if err := _field.Read(iprot); err != nil { + return err + } + p.AuthorizationCode = _field + return nil +} +func (p *OauthFlows) ReadField5(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *OauthFlows) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("OauthFlows"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *OauthFlows) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("implicit", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Implicit.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *OauthFlows) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Password.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *OauthFlows) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("client_credentials", thrift.STRUCT, 3); err != nil { + goto WriteFieldBeginError + } + if err := p.ClientCredentials.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *OauthFlows) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("authorization_code", thrift.STRUCT, 4); err != nil { + goto WriteFieldBeginError + } + if err := p.AuthorizationCode.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *OauthFlows) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *OauthFlows) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("OauthFlows(%+v)", *p) + +} + +type Object struct { + AdditionalProperties []*NamedAny `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewObject() *Object { + return &Object{} +} + +func (p *Object) InitDefault() { +} + +func (p *Object) GetAdditionalProperties() (v []*NamedAny) { + return p.AdditionalProperties +} + +var fieldIDToName_Object = map[int16]string{ + 1: "additional_properties", +} + +func (p *Object) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Object[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Object) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *Object) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Object"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Object) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Object) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Object(%+v)", *p) + +} + +type Operation struct { + Tags []string `thrift:"tags,1" form:"tags" json:"tags" query:"tags"` + Summary string `thrift:"summary,2" form:"summary" json:"summary" query:"summary"` + Description string `thrift:"description,3" form:"description" json:"description" query:"description"` + ExternalDocs *ExternalDocs `thrift:"external_docs,4" form:"external_docs" json:"external_docs" query:"external_docs"` + OperationID string `thrift:"operation_id,5" form:"operation_id" json:"operation_id" query:"operation_id"` + Parameters []*ParameterOrReference `thrift:"parameters,6" form:"parameters" json:"parameters" query:"parameters"` + RequestBody *RequestBodyOrReference `thrift:"request_body,7" form:"request_body" json:"request_body" query:"request_body"` + Responses *Responses `thrift:"responses,8" form:"responses" json:"responses" query:"responses"` + Callbacks *CallbacksOrReferences `thrift:"callbacks,9" form:"callbacks" json:"callbacks" query:"callbacks"` + Deprecated bool `thrift:"deprecated,10" form:"deprecated" json:"deprecated" query:"deprecated"` + Security []*SecurityRequirement `thrift:"security,11" form:"security" json:"security" query:"security"` + Servers []*Server `thrift:"servers,12" form:"servers" json:"servers" query:"servers"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,13" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewOperation() *Operation { + return &Operation{} +} + +func (p *Operation) InitDefault() { +} + +func (p *Operation) GetTags() (v []string) { + return p.Tags +} + +func (p *Operation) GetSummary() (v string) { + return p.Summary +} + +func (p *Operation) GetDescription() (v string) { + return p.Description +} + +var Operation_ExternalDocs_DEFAULT *ExternalDocs + +func (p *Operation) GetExternalDocs() (v *ExternalDocs) { + if !p.IsSetExternalDocs() { + return Operation_ExternalDocs_DEFAULT + } + return p.ExternalDocs +} + +func (p *Operation) GetOperationID() (v string) { + return p.OperationID +} + +func (p *Operation) GetParameters() (v []*ParameterOrReference) { + return p.Parameters +} + +var Operation_RequestBody_DEFAULT *RequestBodyOrReference + +func (p *Operation) GetRequestBody() (v *RequestBodyOrReference) { + if !p.IsSetRequestBody() { + return Operation_RequestBody_DEFAULT + } + return p.RequestBody +} + +var Operation_Responses_DEFAULT *Responses + +func (p *Operation) GetResponses() (v *Responses) { + if !p.IsSetResponses() { + return Operation_Responses_DEFAULT + } + return p.Responses +} + +var Operation_Callbacks_DEFAULT *CallbacksOrReferences + +func (p *Operation) GetCallbacks() (v *CallbacksOrReferences) { + if !p.IsSetCallbacks() { + return Operation_Callbacks_DEFAULT + } + return p.Callbacks +} + +func (p *Operation) GetDeprecated() (v bool) { + return p.Deprecated +} + +func (p *Operation) GetSecurity() (v []*SecurityRequirement) { + return p.Security +} + +func (p *Operation) GetServers() (v []*Server) { + return p.Servers +} + +func (p *Operation) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Operation = map[int16]string{ + 1: "tags", + 2: "summary", + 3: "description", + 4: "external_docs", + 5: "operation_id", + 6: "parameters", + 7: "request_body", + 8: "responses", + 9: "callbacks", + 10: "deprecated", + 11: "security", + 12: "servers", + 13: "specification_extension", +} + +func (p *Operation) IsSetExternalDocs() bool { + return p.ExternalDocs != nil +} + +func (p *Operation) IsSetRequestBody() bool { + return p.RequestBody != nil +} + +func (p *Operation) IsSetResponses() bool { + return p.Responses != nil +} + +func (p *Operation) IsSetCallbacks() bool { + return p.Callbacks != nil +} + +func (p *Operation) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.LIST { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.LIST { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.LIST { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 13: + if fieldTypeId == thrift.LIST { + if err = p.ReadField13(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Operation[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Operation) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]string, 0, size) + for i := 0; i < size; i++ { + + var _elem string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Tags = _field + return nil +} +func (p *Operation) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Summary = _field + return nil +} +func (p *Operation) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *Operation) ReadField4(iprot thrift.TProtocol) error { + _field := NewExternalDocs() + if err := _field.Read(iprot); err != nil { + return err + } + p.ExternalDocs = _field + return nil +} +func (p *Operation) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.OperationID = _field + return nil +} +func (p *Operation) ReadField6(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*ParameterOrReference, 0, size) + values := make([]ParameterOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Parameters = _field + return nil +} +func (p *Operation) ReadField7(iprot thrift.TProtocol) error { + _field := NewRequestBodyOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.RequestBody = _field + return nil +} +func (p *Operation) ReadField8(iprot thrift.TProtocol) error { + _field := NewResponses() + if err := _field.Read(iprot); err != nil { + return err + } + p.Responses = _field + return nil +} +func (p *Operation) ReadField9(iprot thrift.TProtocol) error { + _field := NewCallbacksOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.Callbacks = _field + return nil +} +func (p *Operation) ReadField10(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Deprecated = _field + return nil +} +func (p *Operation) ReadField11(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*SecurityRequirement, 0, size) + values := make([]SecurityRequirement, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Security = _field + return nil +} +func (p *Operation) ReadField12(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*Server, 0, size) + values := make([]Server, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Servers = _field + return nil +} +func (p *Operation) ReadField13(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Operation) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Operation"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } + if err = p.writeField13(oprot); err != nil { + fieldId = 13 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Operation) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("tags", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Tags)); err != nil { + return err + } + for _, v := range p.Tags { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Operation) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("summary", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Summary); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Operation) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Operation) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("external_docs", thrift.STRUCT, 4); err != nil { + goto WriteFieldBeginError + } + if err := p.ExternalDocs.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Operation) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("operation_id", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.OperationID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Operation) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("parameters", thrift.LIST, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Parameters)); err != nil { + return err + } + for _, v := range p.Parameters { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *Operation) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request_body", thrift.STRUCT, 7); err != nil { + goto WriteFieldBeginError + } + if err := p.RequestBody.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *Operation) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("responses", thrift.STRUCT, 8); err != nil { + goto WriteFieldBeginError + } + if err := p.Responses.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *Operation) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("callbacks", thrift.STRUCT, 9); err != nil { + goto WriteFieldBeginError + } + if err := p.Callbacks.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *Operation) writeField10(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("deprecated", thrift.BOOL, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Deprecated); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *Operation) writeField11(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("security", thrift.LIST, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Security)); err != nil { + return err + } + for _, v := range p.Security { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + +func (p *Operation) writeField12(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("servers", thrift.LIST, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Servers)); err != nil { + return err + } + for _, v := range p.Servers { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *Operation) writeField13(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 13); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) +} + +func (p *Operation) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Operation(%+v)", *p) + +} + +type Parameter struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + In string `thrift:"in,2" form:"in" json:"in" query:"in"` + Description string `thrift:"description,3" form:"description" json:"description" query:"description"` + Required bool `thrift:"required,4" form:"required" json:"required" query:"required"` + Deprecated bool `thrift:"deprecated,5" form:"deprecated" json:"deprecated" query:"deprecated"` + AllowEmptyValue bool `thrift:"allow_empty_value,6" form:"allow_empty_value" json:"allow_empty_value" query:"allow_empty_value"` + Style string `thrift:"style,7" form:"style" json:"style" query:"style"` + Explode bool `thrift:"explode,8" form:"explode" json:"explode" query:"explode"` + AllowReserved bool `thrift:"allow_reserved,9" form:"allow_reserved" json:"allow_reserved" query:"allow_reserved"` + Schema *SchemaOrReference `thrift:"schema,10" form:"schema" json:"schema" query:"schema"` + Example *Any `thrift:"example,11" form:"example" json:"example" query:"example"` + Examples *ExamplesOrReferences `thrift:"examples,12" form:"examples" json:"examples" query:"examples"` + Content *MediaTypes `thrift:"content,13" form:"content" json:"content" query:"content"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,14" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewParameter() *Parameter { + return &Parameter{} +} + +func (p *Parameter) InitDefault() { +} + +func (p *Parameter) GetName() (v string) { + return p.Name +} + +func (p *Parameter) GetIn() (v string) { + return p.In +} + +func (p *Parameter) GetDescription() (v string) { + return p.Description +} + +func (p *Parameter) GetRequired() (v bool) { + return p.Required +} + +func (p *Parameter) GetDeprecated() (v bool) { + return p.Deprecated +} + +func (p *Parameter) GetAllowEmptyValue() (v bool) { + return p.AllowEmptyValue +} + +func (p *Parameter) GetStyle() (v string) { + return p.Style +} + +func (p *Parameter) GetExplode() (v bool) { + return p.Explode +} + +func (p *Parameter) GetAllowReserved() (v bool) { + return p.AllowReserved +} + +var Parameter_Schema_DEFAULT *SchemaOrReference + +func (p *Parameter) GetSchema() (v *SchemaOrReference) { + if !p.IsSetSchema() { + return Parameter_Schema_DEFAULT + } + return p.Schema +} + +var Parameter_Example_DEFAULT *Any + +func (p *Parameter) GetExample() (v *Any) { + if !p.IsSetExample() { + return Parameter_Example_DEFAULT + } + return p.Example +} + +var Parameter_Examples_DEFAULT *ExamplesOrReferences + +func (p *Parameter) GetExamples() (v *ExamplesOrReferences) { + if !p.IsSetExamples() { + return Parameter_Examples_DEFAULT + } + return p.Examples +} + +var Parameter_Content_DEFAULT *MediaTypes + +func (p *Parameter) GetContent() (v *MediaTypes) { + if !p.IsSetContent() { + return Parameter_Content_DEFAULT + } + return p.Content +} + +func (p *Parameter) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Parameter = map[int16]string{ + 1: "name", + 2: "in", + 3: "description", + 4: "required", + 5: "deprecated", + 6: "allow_empty_value", + 7: "style", + 8: "explode", + 9: "allow_reserved", + 10: "schema", + 11: "example", + 12: "examples", + 13: "content", + 14: "specification_extension", +} + +func (p *Parameter) IsSetSchema() bool { + return p.Schema != nil +} + +func (p *Parameter) IsSetExample() bool { + return p.Example != nil +} + +func (p *Parameter) IsSetExamples() bool { + return p.Examples != nil +} + +func (p *Parameter) IsSetContent() bool { + return p.Content != nil +} + +func (p *Parameter) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.STRING { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 13: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField13(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 14: + if fieldTypeId == thrift.LIST { + if err = p.ReadField14(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Parameter[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Parameter) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *Parameter) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.In = _field + return nil +} +func (p *Parameter) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *Parameter) ReadField4(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Required = _field + return nil +} +func (p *Parameter) ReadField5(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Deprecated = _field + return nil +} +func (p *Parameter) ReadField6(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.AllowEmptyValue = _field + return nil +} +func (p *Parameter) ReadField7(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Style = _field + return nil +} +func (p *Parameter) ReadField8(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Explode = _field + return nil +} +func (p *Parameter) ReadField9(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.AllowReserved = _field + return nil +} +func (p *Parameter) ReadField10(iprot thrift.TProtocol) error { + _field := NewSchemaOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Schema = _field + return nil +} +func (p *Parameter) ReadField11(iprot thrift.TProtocol) error { + _field := NewAny() + if err := _field.Read(iprot); err != nil { + return err + } + p.Example = _field + return nil +} +func (p *Parameter) ReadField12(iprot thrift.TProtocol) error { + _field := NewExamplesOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.Examples = _field + return nil +} +func (p *Parameter) ReadField13(iprot thrift.TProtocol) error { + _field := NewMediaTypes() + if err := _field.Read(iprot); err != nil { + return err + } + p.Content = _field + return nil +} +func (p *Parameter) ReadField14(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Parameter) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Parameter"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } + if err = p.writeField13(oprot); err != nil { + fieldId = 13 + goto WriteFieldError + } + if err = p.writeField14(oprot); err != nil { + fieldId = 14 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Parameter) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Parameter) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("in", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.In); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Parameter) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Parameter) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("required", thrift.BOOL, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Required); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Parameter) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("deprecated", thrift.BOOL, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Deprecated); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Parameter) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("allow_empty_value", thrift.BOOL, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.AllowEmptyValue); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *Parameter) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("style", thrift.STRING, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Style); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *Parameter) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("explode", thrift.BOOL, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Explode); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *Parameter) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("allow_reserved", thrift.BOOL, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.AllowReserved); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *Parameter) writeField10(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("schema", thrift.STRUCT, 10); err != nil { + goto WriteFieldBeginError + } + if err := p.Schema.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *Parameter) writeField11(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("example", thrift.STRUCT, 11); err != nil { + goto WriteFieldBeginError + } + if err := p.Example.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + +func (p *Parameter) writeField12(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("examples", thrift.STRUCT, 12); err != nil { + goto WriteFieldBeginError + } + if err := p.Examples.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *Parameter) writeField13(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("content", thrift.STRUCT, 13); err != nil { + goto WriteFieldBeginError + } + if err := p.Content.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) +} + +func (p *Parameter) writeField14(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 14); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) +} + +func (p *Parameter) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Parameter(%+v)", *p) + +} + +type ParameterOrReference struct { + Parameter *Parameter `thrift:"parameter,1" form:"parameter" json:"parameter" query:"parameter"` + Reference *Reference `thrift:"reference,2" form:"reference" json:"reference" query:"reference"` +} + +func NewParameterOrReference() *ParameterOrReference { + return &ParameterOrReference{} +} + +func (p *ParameterOrReference) InitDefault() { +} + +var ParameterOrReference_Parameter_DEFAULT *Parameter + +func (p *ParameterOrReference) GetParameter() (v *Parameter) { + if !p.IsSetParameter() { + return ParameterOrReference_Parameter_DEFAULT + } + return p.Parameter +} + +var ParameterOrReference_Reference_DEFAULT *Reference + +func (p *ParameterOrReference) GetReference() (v *Reference) { + if !p.IsSetReference() { + return ParameterOrReference_Reference_DEFAULT + } + return p.Reference +} + +var fieldIDToName_ParameterOrReference = map[int16]string{ + 1: "parameter", + 2: "reference", +} + +func (p *ParameterOrReference) IsSetParameter() bool { + return p.Parameter != nil +} + +func (p *ParameterOrReference) IsSetReference() bool { + return p.Reference != nil +} + +func (p *ParameterOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ParameterOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ParameterOrReference) ReadField1(iprot thrift.TProtocol) error { + _field := NewParameter() + if err := _field.Read(iprot); err != nil { + return err + } + p.Parameter = _field + return nil +} +func (p *ParameterOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Reference = _field + return nil +} + +func (p *ParameterOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ParameterOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *ParameterOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("parameter", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Parameter.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *ParameterOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Reference.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *ParameterOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ParameterOrReference(%+v)", *p) + +} + +type ParametersOrReferences struct { + AdditionalProperties []*NamedParameterOrReference `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewParametersOrReferences() *ParametersOrReferences { + return &ParametersOrReferences{} +} + +func (p *ParametersOrReferences) InitDefault() { +} + +func (p *ParametersOrReferences) GetAdditionalProperties() (v []*NamedParameterOrReference) { + return p.AdditionalProperties +} + +var fieldIDToName_ParametersOrReferences = map[int16]string{ + 1: "additional_properties", +} + +func (p *ParametersOrReferences) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ParametersOrReferences[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ParametersOrReferences) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedParameterOrReference, 0, size) + values := make([]NamedParameterOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *ParametersOrReferences) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ParametersOrReferences"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *ParametersOrReferences) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *ParametersOrReferences) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ParametersOrReferences(%+v)", *p) + +} + +type PathItem struct { + Xref string `thrift:"xref,1" form:"xref" json:"xref" query:"xref"` + Summary string `thrift:"summary,2" form:"summary" json:"summary" query:"summary"` + Description string `thrift:"description,3" form:"description" json:"description" query:"description"` + Get *Operation `thrift:"get,4" form:"get" json:"get" query:"get"` + Put *Operation `thrift:"put,5" form:"put" json:"put" query:"put"` + Post *Operation `thrift:"post,6" form:"post" json:"post" query:"post"` + Delete *Operation `thrift:"delete,7" form:"delete" json:"delete" query:"delete"` + Options *Operation `thrift:"options,8" form:"options" json:"options" query:"options"` + Head *Operation `thrift:"head,9" form:"head" json:"head" query:"head"` + Patch *Operation `thrift:"patch,10" form:"patch" json:"patch" query:"patch"` + Trace *Operation `thrift:"trace,11" form:"trace" json:"trace" query:"trace"` + Servers []*Server `thrift:"servers,12" form:"servers" json:"servers" query:"servers"` + Parameters []*ParameterOrReference `thrift:"parameters,13" form:"parameters" json:"parameters" query:"parameters"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,14" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewPathItem() *PathItem { + return &PathItem{} +} + +func (p *PathItem) InitDefault() { +} + +func (p *PathItem) GetXref() (v string) { + return p.Xref +} + +func (p *PathItem) GetSummary() (v string) { + return p.Summary +} + +func (p *PathItem) GetDescription() (v string) { + return p.Description +} + +var PathItem_Get_DEFAULT *Operation + +func (p *PathItem) GetGet() (v *Operation) { + if !p.IsSetGet() { + return PathItem_Get_DEFAULT + } + return p.Get +} + +var PathItem_Put_DEFAULT *Operation + +func (p *PathItem) GetPut() (v *Operation) { + if !p.IsSetPut() { + return PathItem_Put_DEFAULT + } + return p.Put +} + +var PathItem_Post_DEFAULT *Operation + +func (p *PathItem) GetPost() (v *Operation) { + if !p.IsSetPost() { + return PathItem_Post_DEFAULT + } + return p.Post +} + +var PathItem_Delete_DEFAULT *Operation + +func (p *PathItem) GetDelete() (v *Operation) { + if !p.IsSetDelete() { + return PathItem_Delete_DEFAULT + } + return p.Delete +} + +var PathItem_Options_DEFAULT *Operation + +func (p *PathItem) GetOptions() (v *Operation) { + if !p.IsSetOptions() { + return PathItem_Options_DEFAULT + } + return p.Options +} + +var PathItem_Head_DEFAULT *Operation + +func (p *PathItem) GetHead() (v *Operation) { + if !p.IsSetHead() { + return PathItem_Head_DEFAULT + } + return p.Head +} + +var PathItem_Patch_DEFAULT *Operation + +func (p *PathItem) GetPatch() (v *Operation) { + if !p.IsSetPatch() { + return PathItem_Patch_DEFAULT + } + return p.Patch +} + +var PathItem_Trace_DEFAULT *Operation + +func (p *PathItem) GetTrace() (v *Operation) { + if !p.IsSetTrace() { + return PathItem_Trace_DEFAULT + } + return p.Trace +} + +func (p *PathItem) GetServers() (v []*Server) { + return p.Servers +} + +func (p *PathItem) GetParameters() (v []*ParameterOrReference) { + return p.Parameters +} + +func (p *PathItem) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_PathItem = map[int16]string{ + 1: "xref", + 2: "summary", + 3: "description", + 4: "get", + 5: "put", + 6: "post", + 7: "delete", + 8: "options", + 9: "head", + 10: "patch", + 11: "trace", + 12: "servers", + 13: "parameters", + 14: "specification_extension", +} + +func (p *PathItem) IsSetGet() bool { + return p.Get != nil +} + +func (p *PathItem) IsSetPut() bool { + return p.Put != nil +} + +func (p *PathItem) IsSetPost() bool { + return p.Post != nil +} + +func (p *PathItem) IsSetDelete() bool { + return p.Delete != nil +} + +func (p *PathItem) IsSetOptions() bool { + return p.Options != nil +} + +func (p *PathItem) IsSetHead() bool { + return p.Head != nil +} + +func (p *PathItem) IsSetPatch() bool { + return p.Patch != nil +} + +func (p *PathItem) IsSetTrace() bool { + return p.Trace != nil +} + +func (p *PathItem) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.LIST { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 13: + if fieldTypeId == thrift.LIST { + if err = p.ReadField13(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 14: + if fieldTypeId == thrift.LIST { + if err = p.ReadField14(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PathItem[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *PathItem) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Xref = _field + return nil +} +func (p *PathItem) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Summary = _field + return nil +} +func (p *PathItem) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *PathItem) ReadField4(iprot thrift.TProtocol) error { + _field := NewOperation() + if err := _field.Read(iprot); err != nil { + return err + } + p.Get = _field + return nil +} +func (p *PathItem) ReadField5(iprot thrift.TProtocol) error { + _field := NewOperation() + if err := _field.Read(iprot); err != nil { + return err + } + p.Put = _field + return nil +} +func (p *PathItem) ReadField6(iprot thrift.TProtocol) error { + _field := NewOperation() + if err := _field.Read(iprot); err != nil { + return err + } + p.Post = _field + return nil +} +func (p *PathItem) ReadField7(iprot thrift.TProtocol) error { + _field := NewOperation() + if err := _field.Read(iprot); err != nil { + return err + } + p.Delete = _field + return nil +} +func (p *PathItem) ReadField8(iprot thrift.TProtocol) error { + _field := NewOperation() + if err := _field.Read(iprot); err != nil { + return err + } + p.Options = _field + return nil +} +func (p *PathItem) ReadField9(iprot thrift.TProtocol) error { + _field := NewOperation() + if err := _field.Read(iprot); err != nil { + return err + } + p.Head = _field + return nil +} +func (p *PathItem) ReadField10(iprot thrift.TProtocol) error { + _field := NewOperation() + if err := _field.Read(iprot); err != nil { + return err + } + p.Patch = _field + return nil +} +func (p *PathItem) ReadField11(iprot thrift.TProtocol) error { + _field := NewOperation() + if err := _field.Read(iprot); err != nil { + return err + } + p.Trace = _field + return nil +} +func (p *PathItem) ReadField12(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*Server, 0, size) + values := make([]Server, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Servers = _field + return nil +} +func (p *PathItem) ReadField13(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*ParameterOrReference, 0, size) + values := make([]ParameterOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Parameters = _field + return nil +} +func (p *PathItem) ReadField14(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *PathItem) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("PathItem"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } + if err = p.writeField13(oprot); err != nil { + fieldId = 13 + goto WriteFieldError + } + if err = p.writeField14(oprot); err != nil { + fieldId = 14 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *PathItem) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("xref", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Xref); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *PathItem) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("summary", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Summary); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *PathItem) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *PathItem) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("get", thrift.STRUCT, 4); err != nil { + goto WriteFieldBeginError + } + if err := p.Get.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *PathItem) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("put", thrift.STRUCT, 5); err != nil { + goto WriteFieldBeginError + } + if err := p.Put.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *PathItem) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("post", thrift.STRUCT, 6); err != nil { + goto WriteFieldBeginError + } + if err := p.Post.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *PathItem) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("delete", thrift.STRUCT, 7); err != nil { + goto WriteFieldBeginError + } + if err := p.Delete.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *PathItem) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("options", thrift.STRUCT, 8); err != nil { + goto WriteFieldBeginError + } + if err := p.Options.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *PathItem) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("head", thrift.STRUCT, 9); err != nil { + goto WriteFieldBeginError + } + if err := p.Head.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *PathItem) writeField10(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("patch", thrift.STRUCT, 10); err != nil { + goto WriteFieldBeginError + } + if err := p.Patch.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *PathItem) writeField11(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("trace", thrift.STRUCT, 11); err != nil { + goto WriteFieldBeginError + } + if err := p.Trace.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + +func (p *PathItem) writeField12(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("servers", thrift.LIST, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Servers)); err != nil { + return err + } + for _, v := range p.Servers { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *PathItem) writeField13(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("parameters", thrift.LIST, 13); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Parameters)); err != nil { + return err + } + for _, v := range p.Parameters { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) +} + +func (p *PathItem) writeField14(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 14); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) +} + +func (p *PathItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PathItem(%+v)", *p) + +} + +type Paths struct { + Path []*NamedPathItem `thrift:"path,1" form:"path" json:"path" query:"path"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,2" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewPaths() *Paths { + return &Paths{} +} + +func (p *Paths) InitDefault() { +} + +func (p *Paths) GetPath() (v []*NamedPathItem) { + return p.Path +} + +func (p *Paths) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Paths = map[int16]string{ + 1: "path", + 2: "specification_extension", +} + +func (p *Paths) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.LIST { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Paths[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Paths) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedPathItem, 0, size) + values := make([]NamedPathItem, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Path = _field + return nil +} +func (p *Paths) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Paths) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Paths"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Paths) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("path", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Path)); err != nil { + return err + } + for _, v := range p.Path { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Paths) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Paths) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Paths(%+v)", *p) + +} + +type Properties struct { + AdditionalProperties []*NamedSchemaOrReference `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewProperties() *Properties { + return &Properties{} +} + +func (p *Properties) InitDefault() { +} + +func (p *Properties) GetAdditionalProperties() (v []*NamedSchemaOrReference) { + return p.AdditionalProperties +} + +var fieldIDToName_Properties = map[int16]string{ + 1: "additional_properties", +} + +func (p *Properties) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Properties[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Properties) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedSchemaOrReference, 0, size) + values := make([]NamedSchemaOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *Properties) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Properties"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Properties) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Properties) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Properties(%+v)", *p) + +} + +type Reference struct { + Xref string `thrift:"xref,1" form:"xref" json:"xref" query:"xref"` + Summary string `thrift:"summary,2" form:"summary" json:"summary" query:"summary"` + Description string `thrift:"description,3" form:"description" json:"description" query:"description"` +} + +func NewReference() *Reference { + return &Reference{} +} + +func (p *Reference) InitDefault() { +} + +func (p *Reference) GetXref() (v string) { + return p.Xref +} + +func (p *Reference) GetSummary() (v string) { + return p.Summary +} + +func (p *Reference) GetDescription() (v string) { + return p.Description +} + +var fieldIDToName_Reference = map[int16]string{ + 1: "xref", + 2: "summary", + 3: "description", +} + +func (p *Reference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Reference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Reference) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Xref = _field + return nil +} +func (p *Reference) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Summary = _field + return nil +} +func (p *Reference) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} + +func (p *Reference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Reference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Reference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("xref", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Xref); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Reference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("summary", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Summary); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Reference) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Reference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Reference(%+v)", *p) + +} + +type RequestBody struct { + Description string `thrift:"description,1" form:"description" json:"description" query:"description"` + Content *MediaTypes `thrift:"content,2" form:"content" json:"content" query:"content"` + Required bool `thrift:"required,3" form:"required" json:"required" query:"required"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,4" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewRequestBody() *RequestBody { + return &RequestBody{} +} + +func (p *RequestBody) InitDefault() { +} + +func (p *RequestBody) GetDescription() (v string) { + return p.Description +} + +var RequestBody_Content_DEFAULT *MediaTypes + +func (p *RequestBody) GetContent() (v *MediaTypes) { + if !p.IsSetContent() { + return RequestBody_Content_DEFAULT + } + return p.Content +} + +func (p *RequestBody) GetRequired() (v bool) { + return p.Required +} + +func (p *RequestBody) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_RequestBody = map[int16]string{ + 1: "description", + 2: "content", + 3: "required", + 4: "specification_extension", +} + +func (p *RequestBody) IsSetContent() bool { + return p.Content != nil +} + +func (p *RequestBody) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.LIST { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_RequestBody[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *RequestBody) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *RequestBody) ReadField2(iprot thrift.TProtocol) error { + _field := NewMediaTypes() + if err := _field.Read(iprot); err != nil { + return err + } + p.Content = _field + return nil +} +func (p *RequestBody) ReadField3(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Required = _field + return nil +} +func (p *RequestBody) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *RequestBody) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("RequestBody"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *RequestBody) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *RequestBody) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("content", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Content.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *RequestBody) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("required", thrift.BOOL, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Required); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *RequestBody) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *RequestBody) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RequestBody(%+v)", *p) + +} + +type RequestBodyOrReference struct { + RequestBody *RequestBody `thrift:"request_body,1" form:"request_body" json:"request_body" query:"request_body"` + Reference *Reference `thrift:"reference,2" form:"reference" json:"reference" query:"reference"` +} + +func NewRequestBodyOrReference() *RequestBodyOrReference { + return &RequestBodyOrReference{} +} + +func (p *RequestBodyOrReference) InitDefault() { +} + +var RequestBodyOrReference_RequestBody_DEFAULT *RequestBody + +func (p *RequestBodyOrReference) GetRequestBody() (v *RequestBody) { + if !p.IsSetRequestBody() { + return RequestBodyOrReference_RequestBody_DEFAULT + } + return p.RequestBody +} + +var RequestBodyOrReference_Reference_DEFAULT *Reference + +func (p *RequestBodyOrReference) GetReference() (v *Reference) { + if !p.IsSetReference() { + return RequestBodyOrReference_Reference_DEFAULT + } + return p.Reference +} + +var fieldIDToName_RequestBodyOrReference = map[int16]string{ + 1: "request_body", + 2: "reference", +} + +func (p *RequestBodyOrReference) IsSetRequestBody() bool { + return p.RequestBody != nil +} + +func (p *RequestBodyOrReference) IsSetReference() bool { + return p.Reference != nil +} + +func (p *RequestBodyOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_RequestBodyOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *RequestBodyOrReference) ReadField1(iprot thrift.TProtocol) error { + _field := NewRequestBody() + if err := _field.Read(iprot); err != nil { + return err + } + p.RequestBody = _field + return nil +} +func (p *RequestBodyOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Reference = _field + return nil +} + +func (p *RequestBodyOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("RequestBodyOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *RequestBodyOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request_body", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.RequestBody.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *RequestBodyOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Reference.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *RequestBodyOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RequestBodyOrReference(%+v)", *p) + +} + +type RequestBodiesOrReferences struct { + AdditionalProperties []*NamedRequestBodyOrReference `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewRequestBodiesOrReferences() *RequestBodiesOrReferences { + return &RequestBodiesOrReferences{} +} + +func (p *RequestBodiesOrReferences) InitDefault() { +} + +func (p *RequestBodiesOrReferences) GetAdditionalProperties() (v []*NamedRequestBodyOrReference) { + return p.AdditionalProperties +} + +var fieldIDToName_RequestBodiesOrReferences = map[int16]string{ + 1: "additional_properties", +} + +func (p *RequestBodiesOrReferences) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_RequestBodiesOrReferences[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *RequestBodiesOrReferences) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedRequestBodyOrReference, 0, size) + values := make([]NamedRequestBodyOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *RequestBodiesOrReferences) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("RequestBodiesOrReferences"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *RequestBodiesOrReferences) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *RequestBodiesOrReferences) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RequestBodiesOrReferences(%+v)", *p) + +} + +type Response struct { + Description string `thrift:"description,1" form:"description" json:"description" query:"description"` + Headers *HeadersOrReferences `thrift:"headers,2" form:"headers" json:"headers" query:"headers"` + Content *MediaTypes `thrift:"content,3" form:"content" json:"content" query:"content"` + Links *LinksOrReferences `thrift:"links,4" form:"links" json:"links" query:"links"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,5" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewResponse() *Response { + return &Response{} +} + +func (p *Response) InitDefault() { +} + +func (p *Response) GetDescription() (v string) { + return p.Description +} + +var Response_Headers_DEFAULT *HeadersOrReferences + +func (p *Response) GetHeaders() (v *HeadersOrReferences) { + if !p.IsSetHeaders() { + return Response_Headers_DEFAULT + } + return p.Headers +} + +var Response_Content_DEFAULT *MediaTypes + +func (p *Response) GetContent() (v *MediaTypes) { + if !p.IsSetContent() { + return Response_Content_DEFAULT + } + return p.Content +} + +var Response_Links_DEFAULT *LinksOrReferences + +func (p *Response) GetLinks() (v *LinksOrReferences) { + if !p.IsSetLinks() { + return Response_Links_DEFAULT + } + return p.Links +} + +func (p *Response) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Response = map[int16]string{ + 1: "description", + 2: "headers", + 3: "content", + 4: "links", + 5: "specification_extension", +} + +func (p *Response) IsSetHeaders() bool { + return p.Headers != nil +} + +func (p *Response) IsSetContent() bool { + return p.Content != nil +} + +func (p *Response) IsSetLinks() bool { + return p.Links != nil +} + +func (p *Response) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.LIST { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Response[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Response) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *Response) ReadField2(iprot thrift.TProtocol) error { + _field := NewHeadersOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.Headers = _field + return nil +} +func (p *Response) ReadField3(iprot thrift.TProtocol) error { + _field := NewMediaTypes() + if err := _field.Read(iprot); err != nil { + return err + } + p.Content = _field + return nil +} +func (p *Response) ReadField4(iprot thrift.TProtocol) error { + _field := NewLinksOrReferences() + if err := _field.Read(iprot); err != nil { + return err + } + p.Links = _field + return nil +} +func (p *Response) ReadField5(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Response) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Response"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Response) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Response) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("headers", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Headers.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Response) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("content", thrift.STRUCT, 3); err != nil { + goto WriteFieldBeginError + } + if err := p.Content.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Response) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("links", thrift.STRUCT, 4); err != nil { + goto WriteFieldBeginError + } + if err := p.Links.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Response) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Response) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Response(%+v)", *p) + +} + +type ResponseOrReference struct { + Response *Response `thrift:"response,1" form:"response" json:"response" query:"response"` + Reference *Reference `thrift:"reference,2" form:"reference" json:"reference" query:"reference"` +} + +func NewResponseOrReference() *ResponseOrReference { + return &ResponseOrReference{} +} + +func (p *ResponseOrReference) InitDefault() { +} + +var ResponseOrReference_Response_DEFAULT *Response + +func (p *ResponseOrReference) GetResponse() (v *Response) { + if !p.IsSetResponse() { + return ResponseOrReference_Response_DEFAULT + } + return p.Response +} + +var ResponseOrReference_Reference_DEFAULT *Reference + +func (p *ResponseOrReference) GetReference() (v *Reference) { + if !p.IsSetReference() { + return ResponseOrReference_Reference_DEFAULT + } + return p.Reference +} + +var fieldIDToName_ResponseOrReference = map[int16]string{ + 1: "response", + 2: "reference", +} + +func (p *ResponseOrReference) IsSetResponse() bool { + return p.Response != nil +} + +func (p *ResponseOrReference) IsSetReference() bool { + return p.Reference != nil +} + +func (p *ResponseOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ResponseOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ResponseOrReference) ReadField1(iprot thrift.TProtocol) error { + _field := NewResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Response = _field + return nil +} +func (p *ResponseOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Reference = _field + return nil +} + +func (p *ResponseOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ResponseOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *ResponseOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("response", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Response.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *ResponseOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Reference.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *ResponseOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ResponseOrReference(%+v)", *p) + +} + +type Responses struct { + Default *ResponseOrReference `thrift:"default,1" form:"default" json:"default" query:"default"` + ResponseOrReference []*NamedResponseOrReference `thrift:"response_or_reference,2" form:"response_or_reference" json:"response_or_reference" query:"response_or_reference"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,3" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewResponses() *Responses { + return &Responses{} +} + +func (p *Responses) InitDefault() { +} + +var Responses_Default_DEFAULT *ResponseOrReference + +func (p *Responses) GetDefault() (v *ResponseOrReference) { + if !p.IsSetDefault() { + return Responses_Default_DEFAULT + } + return p.Default +} + +func (p *Responses) GetResponseOrReference() (v []*NamedResponseOrReference) { + return p.ResponseOrReference +} + +func (p *Responses) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Responses = map[int16]string{ + 1: "default", + 2: "response_or_reference", + 3: "specification_extension", +} + +func (p *Responses) IsSetDefault() bool { + return p.Default != nil +} + +func (p *Responses) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.LIST { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.LIST { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Responses[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Responses) ReadField1(iprot thrift.TProtocol) error { + _field := NewResponseOrReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Default = _field + return nil +} +func (p *Responses) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedResponseOrReference, 0, size) + values := make([]NamedResponseOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.ResponseOrReference = _field + return nil +} +func (p *Responses) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Responses) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Responses"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Responses) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("default", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Default.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Responses) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("response_or_reference", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ResponseOrReference)); err != nil { + return err + } + for _, v := range p.ResponseOrReference { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Responses) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Responses) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Responses(%+v)", *p) + +} + +type ResponsesOrReferences struct { + AdditionalProperties []*NamedResponseOrReference `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewResponsesOrReferences() *ResponsesOrReferences { + return &ResponsesOrReferences{} +} + +func (p *ResponsesOrReferences) InitDefault() { +} + +func (p *ResponsesOrReferences) GetAdditionalProperties() (v []*NamedResponseOrReference) { + return p.AdditionalProperties +} + +var fieldIDToName_ResponsesOrReferences = map[int16]string{ + 1: "additional_properties", +} + +func (p *ResponsesOrReferences) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ResponsesOrReferences[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ResponsesOrReferences) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedResponseOrReference, 0, size) + values := make([]NamedResponseOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *ResponsesOrReferences) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ResponsesOrReferences"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *ResponsesOrReferences) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *ResponsesOrReferences) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ResponsesOrReferences(%+v)", *p) + +} + +type Schema struct { + Nullable bool `thrift:"nullable,1" form:"nullable" json:"nullable" query:"nullable"` + Discriminator *Discriminator `thrift:"discriminator,2" form:"discriminator" json:"discriminator" query:"discriminator"` + ReadOnly bool `thrift:"read_only,3" form:"read_only" json:"read_only" query:"read_only"` + WriteOnly bool `thrift:"write_only,4" form:"write_only" json:"write_only" query:"write_only"` + XML *Xml `thrift:"xml,5" form:"xml" json:"xml" query:"xml"` + ExternalDocs *ExternalDocs `thrift:"external_docs,6" form:"external_docs" json:"external_docs" query:"external_docs"` + Example *Any `thrift:"example,7" form:"example" json:"example" query:"example"` + Deprecated bool `thrift:"deprecated,8" form:"deprecated" json:"deprecated" query:"deprecated"` + Title string `thrift:"title,9" form:"title" json:"title" query:"title"` + MultipleOf float64 `thrift:"multiple_of,10" form:"multiple_of" json:"multiple_of" query:"multiple_of"` + Maximum float64 `thrift:"maximum,11" form:"maximum" json:"maximum" query:"maximum"` + ExclusiveMaximum bool `thrift:"exclusive_maximum,12" form:"exclusive_maximum" json:"exclusive_maximum" query:"exclusive_maximum"` + Minimum float64 `thrift:"minimum,13" form:"minimum" json:"minimum" query:"minimum"` + ExclusiveMinimum bool `thrift:"exclusive_minimum,14" form:"exclusive_minimum" json:"exclusive_minimum" query:"exclusive_minimum"` + MaxLength int64 `thrift:"max_length,15" form:"max_length" json:"max_length" query:"max_length"` + MinLength int64 `thrift:"min_length,16" form:"min_length" json:"min_length" query:"min_length"` + Pattern string `thrift:"pattern,17" form:"pattern" json:"pattern" query:"pattern"` + MaxItems int64 `thrift:"max_items,18" form:"max_items" json:"max_items" query:"max_items"` + MinItems int64 `thrift:"min_items,19" form:"min_items" json:"min_items" query:"min_items"` + UniqueItems bool `thrift:"unique_items,20" form:"unique_items" json:"unique_items" query:"unique_items"` + MaxProperties int64 `thrift:"max_properties,21" form:"max_properties" json:"max_properties" query:"max_properties"` + MinProperties int64 `thrift:"min_properties,22" form:"min_properties" json:"min_properties" query:"min_properties"` + Required []string `thrift:"required,23" form:"required" json:"required" query:"required"` + Enum []*Any `thrift:"enum,24" form:"enum" json:"enum" query:"enum"` + Type string `thrift:"type,25" form:"type" json:"type" query:"type"` + AllOf []*SchemaOrReference `thrift:"all_of,26" form:"all_of" json:"all_of" query:"all_of"` + OneOf []*SchemaOrReference `thrift:"one_of,27" form:"one_of" json:"one_of" query:"one_of"` + AnyOf []*SchemaOrReference `thrift:"any_of,28" form:"any_of" json:"any_of" query:"any_of"` + Not *Schema `thrift:"not,29" form:"not" json:"not" query:"not"` + Items *ItemsItem `thrift:"items,30" form:"items" json:"items" query:"items"` + Properties *Properties `thrift:"properties,31" form:"properties" json:"properties" query:"properties"` + AdditionalProperties *AdditionalPropertiesItem `thrift:"additional_properties,32" form:"additional_properties" json:"additional_properties" query:"additional_properties"` + Default *DefaultType `thrift:"default,33" form:"default" json:"default" query:"default"` + Description string `thrift:"description,34" form:"description" json:"description" query:"description"` + Format string `thrift:"format,35" form:"format" json:"format" query:"format"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,36" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewSchema() *Schema { + return &Schema{} +} + +func (p *Schema) InitDefault() { +} + +func (p *Schema) GetNullable() (v bool) { + return p.Nullable +} + +var Schema_Discriminator_DEFAULT *Discriminator + +func (p *Schema) GetDiscriminator() (v *Discriminator) { + if !p.IsSetDiscriminator() { + return Schema_Discriminator_DEFAULT + } + return p.Discriminator +} + +func (p *Schema) GetReadOnly() (v bool) { + return p.ReadOnly +} + +func (p *Schema) GetWriteOnly() (v bool) { + return p.WriteOnly +} + +var Schema_XML_DEFAULT *Xml + +func (p *Schema) GetXML() (v *Xml) { + if !p.IsSetXML() { + return Schema_XML_DEFAULT + } + return p.XML +} + +var Schema_ExternalDocs_DEFAULT *ExternalDocs + +func (p *Schema) GetExternalDocs() (v *ExternalDocs) { + if !p.IsSetExternalDocs() { + return Schema_ExternalDocs_DEFAULT + } + return p.ExternalDocs +} + +var Schema_Example_DEFAULT *Any + +func (p *Schema) GetExample() (v *Any) { + if !p.IsSetExample() { + return Schema_Example_DEFAULT + } + return p.Example +} + +func (p *Schema) GetDeprecated() (v bool) { + return p.Deprecated +} + +func (p *Schema) GetTitle() (v string) { + return p.Title +} + +func (p *Schema) GetMultipleOf() (v float64) { + return p.MultipleOf +} + +func (p *Schema) GetMaximum() (v float64) { + return p.Maximum +} + +func (p *Schema) GetExclusiveMaximum() (v bool) { + return p.ExclusiveMaximum +} + +func (p *Schema) GetMinimum() (v float64) { + return p.Minimum +} + +func (p *Schema) GetExclusiveMinimum() (v bool) { + return p.ExclusiveMinimum +} + +func (p *Schema) GetMaxLength() (v int64) { + return p.MaxLength +} + +func (p *Schema) GetMinLength() (v int64) { + return p.MinLength +} + +func (p *Schema) GetPattern() (v string) { + return p.Pattern +} + +func (p *Schema) GetMaxItems() (v int64) { + return p.MaxItems +} + +func (p *Schema) GetMinItems() (v int64) { + return p.MinItems +} + +func (p *Schema) GetUniqueItems() (v bool) { + return p.UniqueItems +} + +func (p *Schema) GetMaxProperties() (v int64) { + return p.MaxProperties +} + +func (p *Schema) GetMinProperties() (v int64) { + return p.MinProperties +} + +func (p *Schema) GetRequired() (v []string) { + return p.Required +} + +func (p *Schema) GetEnum() (v []*Any) { + return p.Enum +} + +func (p *Schema) GetType() (v string) { + return p.Type +} + +func (p *Schema) GetAllOf() (v []*SchemaOrReference) { + return p.AllOf +} + +func (p *Schema) GetOneOf() (v []*SchemaOrReference) { + return p.OneOf +} + +func (p *Schema) GetAnyOf() (v []*SchemaOrReference) { + return p.AnyOf +} + +var Schema_Not_DEFAULT *Schema + +func (p *Schema) GetNot() (v *Schema) { + if !p.IsSetNot() { + return Schema_Not_DEFAULT + } + return p.Not +} + +var Schema_Items_DEFAULT *ItemsItem + +func (p *Schema) GetItems() (v *ItemsItem) { + if !p.IsSetItems() { + return Schema_Items_DEFAULT + } + return p.Items +} + +var Schema_Properties_DEFAULT *Properties + +func (p *Schema) GetProperties() (v *Properties) { + if !p.IsSetProperties() { + return Schema_Properties_DEFAULT + } + return p.Properties +} + +var Schema_AdditionalProperties_DEFAULT *AdditionalPropertiesItem + +func (p *Schema) GetAdditionalProperties() (v *AdditionalPropertiesItem) { + if !p.IsSetAdditionalProperties() { + return Schema_AdditionalProperties_DEFAULT + } + return p.AdditionalProperties +} + +var Schema_Default_DEFAULT *DefaultType + +func (p *Schema) GetDefault() (v *DefaultType) { + if !p.IsSetDefault() { + return Schema_Default_DEFAULT + } + return p.Default +} + +func (p *Schema) GetDescription() (v string) { + return p.Description +} + +func (p *Schema) GetFormat() (v string) { + return p.Format +} + +func (p *Schema) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Schema = map[int16]string{ + 1: "nullable", + 2: "discriminator", + 3: "read_only", + 4: "write_only", + 5: "xml", + 6: "external_docs", + 7: "example", + 8: "deprecated", + 9: "title", + 10: "multiple_of", + 11: "maximum", + 12: "exclusive_maximum", + 13: "minimum", + 14: "exclusive_minimum", + 15: "max_length", + 16: "min_length", + 17: "pattern", + 18: "max_items", + 19: "min_items", + 20: "unique_items", + 21: "max_properties", + 22: "min_properties", + 23: "required", + 24: "enum", + 25: "type", + 26: "all_of", + 27: "one_of", + 28: "any_of", + 29: "not", + 30: "items", + 31: "properties", + 32: "additional_properties", + 33: "default", + 34: "description", + 35: "format", + 36: "specification_extension", +} + +func (p *Schema) IsSetDiscriminator() bool { + return p.Discriminator != nil +} + +func (p *Schema) IsSetXML() bool { + return p.XML != nil +} + +func (p *Schema) IsSetExternalDocs() bool { + return p.ExternalDocs != nil +} + +func (p *Schema) IsSetExample() bool { + return p.Example != nil +} + +func (p *Schema) IsSetNot() bool { + return p.Not != nil +} + +func (p *Schema) IsSetItems() bool { + return p.Items != nil +} + +func (p *Schema) IsSetProperties() bool { + return p.Properties != nil +} + +func (p *Schema) IsSetAdditionalProperties() bool { + return p.AdditionalProperties != nil +} + +func (p *Schema) IsSetDefault() bool { + return p.Default != nil +} + +func (p *Schema) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.STRING { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.DOUBLE { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.DOUBLE { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 13: + if fieldTypeId == thrift.DOUBLE { + if err = p.ReadField13(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 14: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField14(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 15: + if fieldTypeId == thrift.I64 { + if err = p.ReadField15(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 16: + if fieldTypeId == thrift.I64 { + if err = p.ReadField16(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 17: + if fieldTypeId == thrift.STRING { + if err = p.ReadField17(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 18: + if fieldTypeId == thrift.I64 { + if err = p.ReadField18(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 19: + if fieldTypeId == thrift.I64 { + if err = p.ReadField19(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 20: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField20(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 21: + if fieldTypeId == thrift.I64 { + if err = p.ReadField21(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 22: + if fieldTypeId == thrift.I64 { + if err = p.ReadField22(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 23: + if fieldTypeId == thrift.LIST { + if err = p.ReadField23(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 24: + if fieldTypeId == thrift.LIST { + if err = p.ReadField24(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 25: + if fieldTypeId == thrift.STRING { + if err = p.ReadField25(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 26: + if fieldTypeId == thrift.LIST { + if err = p.ReadField26(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 27: + if fieldTypeId == thrift.LIST { + if err = p.ReadField27(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 28: + if fieldTypeId == thrift.LIST { + if err = p.ReadField28(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 29: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField29(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 30: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField30(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 31: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField31(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 32: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField32(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 33: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField33(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 34: + if fieldTypeId == thrift.STRING { + if err = p.ReadField34(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 35: + if fieldTypeId == thrift.STRING { + if err = p.ReadField35(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 36: + if fieldTypeId == thrift.LIST { + if err = p.ReadField36(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Schema[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Schema) ReadField1(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Nullable = _field + return nil +} +func (p *Schema) ReadField2(iprot thrift.TProtocol) error { + _field := NewDiscriminator() + if err := _field.Read(iprot); err != nil { + return err + } + p.Discriminator = _field + return nil +} +func (p *Schema) ReadField3(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.ReadOnly = _field + return nil +} +func (p *Schema) ReadField4(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.WriteOnly = _field + return nil +} +func (p *Schema) ReadField5(iprot thrift.TProtocol) error { + _field := NewXml() + if err := _field.Read(iprot); err != nil { + return err + } + p.XML = _field + return nil +} +func (p *Schema) ReadField6(iprot thrift.TProtocol) error { + _field := NewExternalDocs() + if err := _field.Read(iprot); err != nil { + return err + } + p.ExternalDocs = _field + return nil +} +func (p *Schema) ReadField7(iprot thrift.TProtocol) error { + _field := NewAny() + if err := _field.Read(iprot); err != nil { + return err + } + p.Example = _field + return nil +} +func (p *Schema) ReadField8(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Deprecated = _field + return nil +} +func (p *Schema) ReadField9(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Title = _field + return nil +} +func (p *Schema) ReadField10(iprot thrift.TProtocol) error { + + var _field float64 + if v, err := iprot.ReadDouble(); err != nil { + return err + } else { + _field = v + } + p.MultipleOf = _field + return nil +} +func (p *Schema) ReadField11(iprot thrift.TProtocol) error { + + var _field float64 + if v, err := iprot.ReadDouble(); err != nil { + return err + } else { + _field = v + } + p.Maximum = _field + return nil +} +func (p *Schema) ReadField12(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.ExclusiveMaximum = _field + return nil +} +func (p *Schema) ReadField13(iprot thrift.TProtocol) error { + + var _field float64 + if v, err := iprot.ReadDouble(); err != nil { + return err + } else { + _field = v + } + p.Minimum = _field + return nil +} +func (p *Schema) ReadField14(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.ExclusiveMinimum = _field + return nil +} +func (p *Schema) ReadField15(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.MaxLength = _field + return nil +} +func (p *Schema) ReadField16(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.MinLength = _field + return nil +} +func (p *Schema) ReadField17(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Pattern = _field + return nil +} +func (p *Schema) ReadField18(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.MaxItems = _field + return nil +} +func (p *Schema) ReadField19(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.MinItems = _field + return nil +} +func (p *Schema) ReadField20(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.UniqueItems = _field + return nil +} +func (p *Schema) ReadField21(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.MaxProperties = _field + return nil +} +func (p *Schema) ReadField22(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.MinProperties = _field + return nil +} +func (p *Schema) ReadField23(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]string, 0, size) + for i := 0; i < size; i++ { + + var _elem string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Required = _field + return nil +} +func (p *Schema) ReadField24(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*Any, 0, size) + values := make([]Any, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Enum = _field + return nil +} +func (p *Schema) ReadField25(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Type = _field + return nil +} +func (p *Schema) ReadField26(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*SchemaOrReference, 0, size) + values := make([]SchemaOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AllOf = _field + return nil +} +func (p *Schema) ReadField27(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*SchemaOrReference, 0, size) + values := make([]SchemaOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.OneOf = _field + return nil +} +func (p *Schema) ReadField28(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*SchemaOrReference, 0, size) + values := make([]SchemaOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AnyOf = _field + return nil +} +func (p *Schema) ReadField29(iprot thrift.TProtocol) error { + _field := NewSchema() + if err := _field.Read(iprot); err != nil { + return err + } + p.Not = _field + return nil +} +func (p *Schema) ReadField30(iprot thrift.TProtocol) error { + _field := NewItemsItem() + if err := _field.Read(iprot); err != nil { + return err + } + p.Items = _field + return nil +} +func (p *Schema) ReadField31(iprot thrift.TProtocol) error { + _field := NewProperties() + if err := _field.Read(iprot); err != nil { + return err + } + p.Properties = _field + return nil +} +func (p *Schema) ReadField32(iprot thrift.TProtocol) error { + _field := NewAdditionalPropertiesItem() + if err := _field.Read(iprot); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} +func (p *Schema) ReadField33(iprot thrift.TProtocol) error { + _field := NewDefaultType() + if err := _field.Read(iprot); err != nil { + return err + } + p.Default = _field + return nil +} +func (p *Schema) ReadField34(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *Schema) ReadField35(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Format = _field + return nil +} +func (p *Schema) ReadField36(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Schema) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Schema"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } + if err = p.writeField13(oprot); err != nil { + fieldId = 13 + goto WriteFieldError + } + if err = p.writeField14(oprot); err != nil { + fieldId = 14 + goto WriteFieldError + } + if err = p.writeField15(oprot); err != nil { + fieldId = 15 + goto WriteFieldError + } + if err = p.writeField16(oprot); err != nil { + fieldId = 16 + goto WriteFieldError + } + if err = p.writeField17(oprot); err != nil { + fieldId = 17 + goto WriteFieldError + } + if err = p.writeField18(oprot); err != nil { + fieldId = 18 + goto WriteFieldError + } + if err = p.writeField19(oprot); err != nil { + fieldId = 19 + goto WriteFieldError + } + if err = p.writeField20(oprot); err != nil { + fieldId = 20 + goto WriteFieldError + } + if err = p.writeField21(oprot); err != nil { + fieldId = 21 + goto WriteFieldError + } + if err = p.writeField22(oprot); err != nil { + fieldId = 22 + goto WriteFieldError + } + if err = p.writeField23(oprot); err != nil { + fieldId = 23 + goto WriteFieldError + } + if err = p.writeField24(oprot); err != nil { + fieldId = 24 + goto WriteFieldError + } + if err = p.writeField25(oprot); err != nil { + fieldId = 25 + goto WriteFieldError + } + if err = p.writeField26(oprot); err != nil { + fieldId = 26 + goto WriteFieldError + } + if err = p.writeField27(oprot); err != nil { + fieldId = 27 + goto WriteFieldError + } + if err = p.writeField28(oprot); err != nil { + fieldId = 28 + goto WriteFieldError + } + if err = p.writeField29(oprot); err != nil { + fieldId = 29 + goto WriteFieldError + } + if err = p.writeField30(oprot); err != nil { + fieldId = 30 + goto WriteFieldError + } + if err = p.writeField31(oprot); err != nil { + fieldId = 31 + goto WriteFieldError + } + if err = p.writeField32(oprot); err != nil { + fieldId = 32 + goto WriteFieldError + } + if err = p.writeField33(oprot); err != nil { + fieldId = 33 + goto WriteFieldError + } + if err = p.writeField34(oprot); err != nil { + fieldId = 34 + goto WriteFieldError + } + if err = p.writeField35(oprot); err != nil { + fieldId = 35 + goto WriteFieldError + } + if err = p.writeField36(oprot); err != nil { + fieldId = 36 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Schema) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("nullable", thrift.BOOL, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Nullable); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Schema) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("discriminator", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Discriminator.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Schema) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("read_only", thrift.BOOL, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.ReadOnly); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Schema) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("write_only", thrift.BOOL, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.WriteOnly); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Schema) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("xml", thrift.STRUCT, 5); err != nil { + goto WriteFieldBeginError + } + if err := p.XML.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Schema) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("external_docs", thrift.STRUCT, 6); err != nil { + goto WriteFieldBeginError + } + if err := p.ExternalDocs.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *Schema) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("example", thrift.STRUCT, 7); err != nil { + goto WriteFieldBeginError + } + if err := p.Example.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *Schema) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("deprecated", thrift.BOOL, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Deprecated); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *Schema) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("title", thrift.STRING, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Title); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *Schema) writeField10(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("multiple_of", thrift.DOUBLE, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteDouble(p.MultipleOf); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *Schema) writeField11(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("maximum", thrift.DOUBLE, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteDouble(p.Maximum); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + +func (p *Schema) writeField12(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("exclusive_maximum", thrift.BOOL, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.ExclusiveMaximum); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *Schema) writeField13(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("minimum", thrift.DOUBLE, 13); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteDouble(p.Minimum); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) +} + +func (p *Schema) writeField14(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("exclusive_minimum", thrift.BOOL, 14); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.ExclusiveMinimum); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) +} + +func (p *Schema) writeField15(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("max_length", thrift.I64, 15); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.MaxLength); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 15 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 15 end error: ", p), err) +} + +func (p *Schema) writeField16(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("min_length", thrift.I64, 16); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.MinLength); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 16 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 16 end error: ", p), err) +} + +func (p *Schema) writeField17(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("pattern", thrift.STRING, 17); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Pattern); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 17 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 17 end error: ", p), err) +} + +func (p *Schema) writeField18(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("max_items", thrift.I64, 18); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.MaxItems); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 18 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 18 end error: ", p), err) +} + +func (p *Schema) writeField19(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("min_items", thrift.I64, 19); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.MinItems); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 19 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 19 end error: ", p), err) +} + +func (p *Schema) writeField20(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("unique_items", thrift.BOOL, 20); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.UniqueItems); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 end error: ", p), err) +} + +func (p *Schema) writeField21(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("max_properties", thrift.I64, 21); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.MaxProperties); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 21 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 21 end error: ", p), err) +} + +func (p *Schema) writeField22(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("min_properties", thrift.I64, 22); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.MinProperties); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 22 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 22 end error: ", p), err) +} + +func (p *Schema) writeField23(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("required", thrift.LIST, 23); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Required)); err != nil { + return err + } + for _, v := range p.Required { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 23 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 23 end error: ", p), err) +} + +func (p *Schema) writeField24(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("enum", thrift.LIST, 24); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Enum)); err != nil { + return err + } + for _, v := range p.Enum { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 24 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 24 end error: ", p), err) +} + +func (p *Schema) writeField25(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("type", thrift.STRING, 25); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Type); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 25 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 25 end error: ", p), err) +} + +func (p *Schema) writeField26(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("all_of", thrift.LIST, 26); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AllOf)); err != nil { + return err + } + for _, v := range p.AllOf { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 26 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 26 end error: ", p), err) +} + +func (p *Schema) writeField27(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("one_of", thrift.LIST, 27); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.OneOf)); err != nil { + return err + } + for _, v := range p.OneOf { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 27 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 27 end error: ", p), err) +} + +func (p *Schema) writeField28(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("any_of", thrift.LIST, 28); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AnyOf)); err != nil { + return err + } + for _, v := range p.AnyOf { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 28 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 28 end error: ", p), err) +} + +func (p *Schema) writeField29(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("not", thrift.STRUCT, 29); err != nil { + goto WriteFieldBeginError + } + if err := p.Not.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 29 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 29 end error: ", p), err) +} + +func (p *Schema) writeField30(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("items", thrift.STRUCT, 30); err != nil { + goto WriteFieldBeginError + } + if err := p.Items.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 30 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 30 end error: ", p), err) +} + +func (p *Schema) writeField31(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("properties", thrift.STRUCT, 31); err != nil { + goto WriteFieldBeginError + } + if err := p.Properties.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 31 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 31 end error: ", p), err) +} + +func (p *Schema) writeField32(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.STRUCT, 32); err != nil { + goto WriteFieldBeginError + } + if err := p.AdditionalProperties.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 32 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 32 end error: ", p), err) +} + +func (p *Schema) writeField33(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("default", thrift.STRUCT, 33); err != nil { + goto WriteFieldBeginError + } + if err := p.Default.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 33 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 33 end error: ", p), err) +} + +func (p *Schema) writeField34(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 34); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 34 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 34 end error: ", p), err) +} + +func (p *Schema) writeField35(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("format", thrift.STRING, 35); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Format); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 35 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 35 end error: ", p), err) +} + +func (p *Schema) writeField36(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 36); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 36 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 36 end error: ", p), err) +} + +func (p *Schema) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Schema(%+v)", *p) + +} + +type SchemaOrReference struct { + Schema *Schema `thrift:"schema,1" form:"schema" json:"schema" query:"schema"` + Reference *Reference `thrift:"reference,2" form:"reference" json:"reference" query:"reference"` +} + +func NewSchemaOrReference() *SchemaOrReference { + return &SchemaOrReference{} +} + +func (p *SchemaOrReference) InitDefault() { +} + +var SchemaOrReference_Schema_DEFAULT *Schema + +func (p *SchemaOrReference) GetSchema() (v *Schema) { + if !p.IsSetSchema() { + return SchemaOrReference_Schema_DEFAULT + } + return p.Schema +} + +var SchemaOrReference_Reference_DEFAULT *Reference + +func (p *SchemaOrReference) GetReference() (v *Reference) { + if !p.IsSetReference() { + return SchemaOrReference_Reference_DEFAULT + } + return p.Reference +} + +var fieldIDToName_SchemaOrReference = map[int16]string{ + 1: "schema", + 2: "reference", +} + +func (p *SchemaOrReference) IsSetSchema() bool { + return p.Schema != nil +} + +func (p *SchemaOrReference) IsSetReference() bool { + return p.Reference != nil +} + +func (p *SchemaOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SchemaOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *SchemaOrReference) ReadField1(iprot thrift.TProtocol) error { + _field := NewSchema() + if err := _field.Read(iprot); err != nil { + return err + } + p.Schema = _field + return nil +} +func (p *SchemaOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Reference = _field + return nil +} + +func (p *SchemaOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SchemaOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *SchemaOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("schema", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Schema.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *SchemaOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Reference.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *SchemaOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SchemaOrReference(%+v)", *p) + +} + +type SchemasOrReferences struct { + AdditionalProperties []*NamedSchemaOrReference `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewSchemasOrReferences() *SchemasOrReferences { + return &SchemasOrReferences{} +} + +func (p *SchemasOrReferences) InitDefault() { +} + +func (p *SchemasOrReferences) GetAdditionalProperties() (v []*NamedSchemaOrReference) { + return p.AdditionalProperties +} + +var fieldIDToName_SchemasOrReferences = map[int16]string{ + 1: "additional_properties", +} + +func (p *SchemasOrReferences) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SchemasOrReferences[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *SchemasOrReferences) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedSchemaOrReference, 0, size) + values := make([]NamedSchemaOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *SchemasOrReferences) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SchemasOrReferences"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *SchemasOrReferences) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *SchemasOrReferences) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SchemasOrReferences(%+v)", *p) + +} + +type SecurityRequirement struct { + AdditionalProperties []*NamedStringArray `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewSecurityRequirement() *SecurityRequirement { + return &SecurityRequirement{} +} + +func (p *SecurityRequirement) InitDefault() { +} + +func (p *SecurityRequirement) GetAdditionalProperties() (v []*NamedStringArray) { + return p.AdditionalProperties +} + +var fieldIDToName_SecurityRequirement = map[int16]string{ + 1: "additional_properties", +} + +func (p *SecurityRequirement) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SecurityRequirement[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *SecurityRequirement) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedStringArray, 0, size) + values := make([]NamedStringArray, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *SecurityRequirement) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SecurityRequirement"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *SecurityRequirement) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *SecurityRequirement) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SecurityRequirement(%+v)", *p) + +} + +type SecurityScheme struct { + _Type string `thrift:"_type,1" form:"_type" json:"_type" query:"_type"` + Description string `thrift:"description,2" form:"description" json:"description" query:"description"` + Name string `thrift:"name,3" form:"name" json:"name" query:"name"` + _In string `thrift:"_in,4" form:"_in" json:"_in" query:"_in"` + Scheme string `thrift:"scheme,5" form:"scheme" json:"scheme" query:"scheme"` + BearerFormat string `thrift:"bearer_format,6" form:"bearer_format" json:"bearer_format" query:"bearer_format"` + Flows *OauthFlows `thrift:"flows,7" form:"flows" json:"flows" query:"flows"` + OpenIDConnectURL string `thrift:"open_id_connect_url,8" form:"open_id_connect_url" json:"open_id_connect_url" query:"open_id_connect_url"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,9" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewSecurityScheme() *SecurityScheme { + return &SecurityScheme{} +} + +func (p *SecurityScheme) InitDefault() { +} + +func (p *SecurityScheme) Get_Type() (v string) { + return p._Type +} + +func (p *SecurityScheme) GetDescription() (v string) { + return p.Description +} + +func (p *SecurityScheme) GetName() (v string) { + return p.Name +} + +func (p *SecurityScheme) Get_In() (v string) { + return p._In +} + +func (p *SecurityScheme) GetScheme() (v string) { + return p.Scheme +} + +func (p *SecurityScheme) GetBearerFormat() (v string) { + return p.BearerFormat +} + +var SecurityScheme_Flows_DEFAULT *OauthFlows + +func (p *SecurityScheme) GetFlows() (v *OauthFlows) { + if !p.IsSetFlows() { + return SecurityScheme_Flows_DEFAULT + } + return p.Flows +} + +func (p *SecurityScheme) GetOpenIDConnectURL() (v string) { + return p.OpenIDConnectURL +} + +func (p *SecurityScheme) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_SecurityScheme = map[int16]string{ + 1: "_type", + 2: "description", + 3: "name", + 4: "_in", + 5: "scheme", + 6: "bearer_format", + 7: "flows", + 8: "open_id_connect_url", + 9: "specification_extension", +} + +func (p *SecurityScheme) IsSetFlows() bool { + return p.Flows != nil +} + +func (p *SecurityScheme) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRING { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.STRING { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.LIST { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SecurityScheme[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *SecurityScheme) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p._Type = _field + return nil +} +func (p *SecurityScheme) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *SecurityScheme) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *SecurityScheme) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p._In = _field + return nil +} +func (p *SecurityScheme) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Scheme = _field + return nil +} +func (p *SecurityScheme) ReadField6(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.BearerFormat = _field + return nil +} +func (p *SecurityScheme) ReadField7(iprot thrift.TProtocol) error { + _field := NewOauthFlows() + if err := _field.Read(iprot); err != nil { + return err + } + p.Flows = _field + return nil +} +func (p *SecurityScheme) ReadField8(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.OpenIDConnectURL = _field + return nil +} +func (p *SecurityScheme) ReadField9(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *SecurityScheme) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SecurityScheme"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *SecurityScheme) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("_type", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p._Type); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *SecurityScheme) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *SecurityScheme) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *SecurityScheme) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("_in", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p._In); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *SecurityScheme) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("scheme", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Scheme); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *SecurityScheme) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("bearer_format", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.BearerFormat); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *SecurityScheme) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("flows", thrift.STRUCT, 7); err != nil { + goto WriteFieldBeginError + } + if err := p.Flows.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *SecurityScheme) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("open_id_connect_url", thrift.STRING, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.OpenIDConnectURL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *SecurityScheme) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *SecurityScheme) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SecurityScheme(%+v)", *p) + +} + +type SecuritySchemeOrReference struct { + SecurityScheme *SecurityScheme `thrift:"security_scheme,1" form:"security_scheme" json:"security_scheme" query:"security_scheme"` + Reference *Reference `thrift:"reference,2" form:"reference" json:"reference" query:"reference"` +} + +func NewSecuritySchemeOrReference() *SecuritySchemeOrReference { + return &SecuritySchemeOrReference{} +} + +func (p *SecuritySchemeOrReference) InitDefault() { +} + +var SecuritySchemeOrReference_SecurityScheme_DEFAULT *SecurityScheme + +func (p *SecuritySchemeOrReference) GetSecurityScheme() (v *SecurityScheme) { + if !p.IsSetSecurityScheme() { + return SecuritySchemeOrReference_SecurityScheme_DEFAULT + } + return p.SecurityScheme +} + +var SecuritySchemeOrReference_Reference_DEFAULT *Reference + +func (p *SecuritySchemeOrReference) GetReference() (v *Reference) { + if !p.IsSetReference() { + return SecuritySchemeOrReference_Reference_DEFAULT + } + return p.Reference +} + +var fieldIDToName_SecuritySchemeOrReference = map[int16]string{ + 1: "security_scheme", + 2: "reference", +} + +func (p *SecuritySchemeOrReference) IsSetSecurityScheme() bool { + return p.SecurityScheme != nil +} + +func (p *SecuritySchemeOrReference) IsSetReference() bool { + return p.Reference != nil +} + +func (p *SecuritySchemeOrReference) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SecuritySchemeOrReference[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *SecuritySchemeOrReference) ReadField1(iprot thrift.TProtocol) error { + _field := NewSecurityScheme() + if err := _field.Read(iprot); err != nil { + return err + } + p.SecurityScheme = _field + return nil +} +func (p *SecuritySchemeOrReference) ReadField2(iprot thrift.TProtocol) error { + _field := NewReference() + if err := _field.Read(iprot); err != nil { + return err + } + p.Reference = _field + return nil +} + +func (p *SecuritySchemeOrReference) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SecuritySchemeOrReference"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *SecuritySchemeOrReference) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("security_scheme", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.SecurityScheme.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *SecuritySchemeOrReference) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Reference.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *SecuritySchemeOrReference) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SecuritySchemeOrReference(%+v)", *p) + +} + +type SecuritySchemesOrReferences struct { + AdditionalProperties []*NamedSecuritySchemeOrReference `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewSecuritySchemesOrReferences() *SecuritySchemesOrReferences { + return &SecuritySchemesOrReferences{} +} + +func (p *SecuritySchemesOrReferences) InitDefault() { +} + +func (p *SecuritySchemesOrReferences) GetAdditionalProperties() (v []*NamedSecuritySchemeOrReference) { + return p.AdditionalProperties +} + +var fieldIDToName_SecuritySchemesOrReferences = map[int16]string{ + 1: "additional_properties", +} + +func (p *SecuritySchemesOrReferences) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SecuritySchemesOrReferences[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *SecuritySchemesOrReferences) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedSecuritySchemeOrReference, 0, size) + values := make([]NamedSecuritySchemeOrReference, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *SecuritySchemesOrReferences) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SecuritySchemesOrReferences"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *SecuritySchemesOrReferences) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *SecuritySchemesOrReferences) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SecuritySchemesOrReferences(%+v)", *p) + +} + +type Server struct { + URL string `thrift:"url,1" form:"url" json:"url" query:"url"` + Description string `thrift:"description,2" form:"description" json:"description" query:"description"` + Variables *ServerVariables `thrift:"variables,3" form:"variables" json:"variables" query:"variables"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,4" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewServer() *Server { + return &Server{} +} + +func (p *Server) InitDefault() { +} + +func (p *Server) GetURL() (v string) { + return p.URL +} + +func (p *Server) GetDescription() (v string) { + return p.Description +} + +var Server_Variables_DEFAULT *ServerVariables + +func (p *Server) GetVariables() (v *ServerVariables) { + if !p.IsSetVariables() { + return Server_Variables_DEFAULT + } + return p.Variables +} + +func (p *Server) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Server = map[int16]string{ + 1: "url", + 2: "description", + 3: "variables", + 4: "specification_extension", +} + +func (p *Server) IsSetVariables() bool { + return p.Variables != nil +} + +func (p *Server) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.LIST { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Server[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Server) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.URL = _field + return nil +} +func (p *Server) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *Server) ReadField3(iprot thrift.TProtocol) error { + _field := NewServerVariables() + if err := _field.Read(iprot); err != nil { + return err + } + p.Variables = _field + return nil +} +func (p *Server) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Server) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Server"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Server) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.URL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Server) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Server) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("variables", thrift.STRUCT, 3); err != nil { + goto WriteFieldBeginError + } + if err := p.Variables.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Server) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Server) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Server(%+v)", *p) + +} + +type ServerVariable struct { + _Default string `thrift:"_default,1" form:"_default" json:"_default" query:"_default"` + Enum []string `thrift:"enum,2" form:"enum" json:"enum" query:"enum"` + Description string `thrift:"description,3" form:"description" json:"description" query:"description"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,4" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewServerVariable() *ServerVariable { + return &ServerVariable{} +} + +func (p *ServerVariable) InitDefault() { +} + +func (p *ServerVariable) Get_Default() (v string) { + return p._Default +} + +func (p *ServerVariable) GetEnum() (v []string) { + return p.Enum +} + +func (p *ServerVariable) GetDescription() (v string) { + return p.Description +} + +func (p *ServerVariable) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_ServerVariable = map[int16]string{ + 1: "_default", + 2: "enum", + 3: "description", + 4: "specification_extension", +} + +func (p *ServerVariable) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.LIST { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.LIST { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ServerVariable[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ServerVariable) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p._Default = _field + return nil +} +func (p *ServerVariable) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]string, 0, size) + for i := 0; i < size; i++ { + + var _elem string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Enum = _field + return nil +} +func (p *ServerVariable) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *ServerVariable) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *ServerVariable) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ServerVariable"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *ServerVariable) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("_default", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p._Default); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *ServerVariable) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("enum", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Enum)); err != nil { + return err + } + for _, v := range p.Enum { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *ServerVariable) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *ServerVariable) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *ServerVariable) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ServerVariable(%+v)", *p) + +} + +type ServerVariables struct { + AdditionalProperties []*NamedServerVariable `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewServerVariables() *ServerVariables { + return &ServerVariables{} +} + +func (p *ServerVariables) InitDefault() { +} + +func (p *ServerVariables) GetAdditionalProperties() (v []*NamedServerVariable) { + return p.AdditionalProperties +} + +var fieldIDToName_ServerVariables = map[int16]string{ + 1: "additional_properties", +} + +func (p *ServerVariables) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ServerVariables[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ServerVariables) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedServerVariable, 0, size) + values := make([]NamedServerVariable, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *ServerVariables) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ServerVariables"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *ServerVariables) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *ServerVariables) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ServerVariables(%+v)", *p) + +} + +type SpecificationExtension struct { + Number float64 `thrift:"number,1" form:"number" json:"number" query:"number"` + Boolean bool `thrift:"boolean,2" form:"boolean" json:"boolean" query:"boolean"` + String_ string `thrift:"string,3" form:"string" json:"string" query:"string"` +} + +func NewSpecificationExtension() *SpecificationExtension { + return &SpecificationExtension{} +} + +func (p *SpecificationExtension) InitDefault() { +} + +func (p *SpecificationExtension) GetNumber() (v float64) { + return p.Number +} + +func (p *SpecificationExtension) GetBoolean() (v bool) { + return p.Boolean +} + +func (p *SpecificationExtension) GetString() (v string) { + return p.String_ +} + +var fieldIDToName_SpecificationExtension = map[int16]string{ + 1: "number", + 2: "boolean", + 3: "string", +} + +func (p *SpecificationExtension) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.DOUBLE { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SpecificationExtension[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *SpecificationExtension) ReadField1(iprot thrift.TProtocol) error { + + var _field float64 + if v, err := iprot.ReadDouble(); err != nil { + return err + } else { + _field = v + } + p.Number = _field + return nil +} +func (p *SpecificationExtension) ReadField2(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Boolean = _field + return nil +} +func (p *SpecificationExtension) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.String_ = _field + return nil +} + +func (p *SpecificationExtension) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SpecificationExtension"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *SpecificationExtension) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("number", thrift.DOUBLE, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteDouble(p.Number); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *SpecificationExtension) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("boolean", thrift.BOOL, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Boolean); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *SpecificationExtension) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("string", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.String_); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *SpecificationExtension) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SpecificationExtension(%+v)", *p) + +} + +type StringArray struct { + Values []string `thrift:"values,1" form:"values" json:"values" query:"values"` +} + +func NewStringArray() *StringArray { + return &StringArray{} +} + +func (p *StringArray) InitDefault() { +} + +func (p *StringArray) GetValues() (v []string) { + return p.Values +} + +var fieldIDToName_StringArray = map[int16]string{ + 1: "values", +} + +func (p *StringArray) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_StringArray[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *StringArray) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]string, 0, size) + for i := 0; i < size; i++ { + + var _elem string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Values = _field + return nil +} + +func (p *StringArray) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("StringArray"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *StringArray) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil { + return err + } + for _, v := range p.Values { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *StringArray) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StringArray(%+v)", *p) + +} + +type Strings struct { + AdditionalProperties []*NamedString `thrift:"additional_properties,1" form:"additional_properties" json:"additional_properties" query:"additional_properties"` +} + +func NewStrings() *Strings { + return &Strings{} +} + +func (p *Strings) InitDefault() { +} + +func (p *Strings) GetAdditionalProperties() (v []*NamedString) { + return p.AdditionalProperties +} + +var fieldIDToName_Strings = map[int16]string{ + 1: "additional_properties", +} + +func (p *Strings) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Strings[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Strings) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedString, 0, size) + values := make([]NamedString, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.AdditionalProperties = _field + return nil +} + +func (p *Strings) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Strings"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Strings) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil { + return err + } + for _, v := range p.AdditionalProperties { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Strings) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Strings(%+v)", *p) + +} + +type Tag struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Description string `thrift:"description,2" form:"description" json:"description" query:"description"` + ExternalDocs *ExternalDocs `thrift:"external_docs,3" form:"external_docs" json:"external_docs" query:"external_docs"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,4" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewTag() *Tag { + return &Tag{} +} + +func (p *Tag) InitDefault() { +} + +func (p *Tag) GetName() (v string) { + return p.Name +} + +func (p *Tag) GetDescription() (v string) { + return p.Description +} + +var Tag_ExternalDocs_DEFAULT *ExternalDocs + +func (p *Tag) GetExternalDocs() (v *ExternalDocs) { + if !p.IsSetExternalDocs() { + return Tag_ExternalDocs_DEFAULT + } + return p.ExternalDocs +} + +func (p *Tag) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Tag = map[int16]string{ + 1: "name", + 2: "description", + 3: "external_docs", + 4: "specification_extension", +} + +func (p *Tag) IsSetExternalDocs() bool { + return p.ExternalDocs != nil +} + +func (p *Tag) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.LIST { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Tag[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Tag) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *Tag) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Description = _field + return nil +} +func (p *Tag) ReadField3(iprot thrift.TProtocol) error { + _field := NewExternalDocs() + if err := _field.Read(iprot); err != nil { + return err + } + p.ExternalDocs = _field + return nil +} +func (p *Tag) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Tag) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Tag"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Tag) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Tag) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Tag) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("external_docs", thrift.STRUCT, 3); err != nil { + goto WriteFieldBeginError + } + if err := p.ExternalDocs.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Tag) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Tag) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Tag(%+v)", *p) + +} + +type Xml struct { + Name string `thrift:"name,1" form:"name" json:"name" query:"name"` + Namespace string `thrift:"namespace,2" form:"namespace" json:"namespace" query:"namespace"` + Prefix string `thrift:"prefix,3" form:"prefix" json:"prefix" query:"prefix"` + Attribute bool `thrift:"attribute,4" form:"attribute" json:"attribute" query:"attribute"` + Wrapped bool `thrift:"wrapped,5" form:"wrapped" json:"wrapped" query:"wrapped"` + SpecificationExtension []*NamedAny `thrift:"specification_extension,6" form:"specification_extension" json:"specification_extension" query:"specification_extension"` +} + +func NewXml() *Xml { + return &Xml{} +} + +func (p *Xml) InitDefault() { +} + +func (p *Xml) GetName() (v string) { + return p.Name +} + +func (p *Xml) GetNamespace() (v string) { + return p.Namespace +} + +func (p *Xml) GetPrefix() (v string) { + return p.Prefix +} + +func (p *Xml) GetAttribute() (v bool) { + return p.Attribute +} + +func (p *Xml) GetWrapped() (v bool) { + return p.Wrapped +} + +func (p *Xml) GetSpecificationExtension() (v []*NamedAny) { + return p.SpecificationExtension +} + +var fieldIDToName_Xml = map[int16]string{ + 1: "name", + 2: "namespace", + 3: "prefix", + 4: "attribute", + 5: "wrapped", + 6: "specification_extension", +} + +func (p *Xml) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.LIST { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Xml[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Xml) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *Xml) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Namespace = _field + return nil +} +func (p *Xml) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Prefix = _field + return nil +} +func (p *Xml) ReadField4(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Attribute = _field + return nil +} +func (p *Xml) ReadField5(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.Wrapped = _field + return nil +} +func (p *Xml) ReadField6(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*NamedAny, 0, size) + values := make([]NamedAny, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpecificationExtension = _field + return nil +} + +func (p *Xml) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Xml"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Xml) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Xml) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("namespace", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Namespace); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Xml) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("prefix", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Prefix); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Xml) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("attribute", thrift.BOOL, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Attribute); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Xml) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("wrapped", thrift.BOOL, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.Wrapped); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Xml) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil { + return err + } + for _, v := range p.SpecificationExtension { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *Xml) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Xml(%+v)", *p) + +} diff --git a/bizdemo/hertz_swagger_gen/biz/hertz_gen/user/user.go b/bizdemo/hertz_swagger_gen/biz/hertz_gen/user/user.go new file mode 100644 index 00000000..5e52da6c --- /dev/null +++ b/bizdemo/hertz_swagger_gen/biz/hertz_gen/user/user.go @@ -0,0 +1,3757 @@ +// Code generated by thriftgo (0.3.14). DO NOT EDIT. + +package user + +import ( + "context" + "database/sql" + "database/sql/driver" + "fmt" + "github.com/apache/thrift/lib/go/thrift" +) + +type Code int64 + +const ( + Code_Success Code = 1 + Code_ParamInvalid Code = 2 + Code_DBErr Code = 3 +) + +func (p Code) String() string { + switch p { + case Code_Success: + return "Success" + case Code_ParamInvalid: + return "ParamInvalid" + case Code_DBErr: + return "DBErr" + } + return "" +} + +func CodeFromString(s string) (Code, error) { + switch s { + case "Success": + return Code_Success, nil + case "ParamInvalid": + return Code_ParamInvalid, nil + case "DBErr": + return Code_DBErr, nil + } + return Code(0), fmt.Errorf("not a valid Code string") +} + +func CodePtr(v Code) *Code { return &v } +func (p *Code) Scan(value interface{}) (err error) { + var result sql.NullInt64 + err = result.Scan(value) + *p = Code(result.Int64) + return +} + +func (p *Code) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type Gender int64 + +const ( + Gender_Unknown Gender = 0 + Gender_Male Gender = 1 + Gender_Female Gender = 2 +) + +func (p Gender) String() string { + switch p { + case Gender_Unknown: + return "Unknown" + case Gender_Male: + return "Male" + case Gender_Female: + return "Female" + } + return "" +} + +func GenderFromString(s string) (Gender, error) { + switch s { + case "Unknown": + return Gender_Unknown, nil + case "Male": + return Gender_Male, nil + case "Female": + return Gender_Female, nil + } + return Gender(0), fmt.Errorf("not a valid Gender string") +} + +func GenderPtr(v Gender) *Gender { return &v } +func (p *Gender) Scan(value interface{}) (err error) { + var result sql.NullInt64 + err = result.Scan(value) + *p = Gender(result.Int64) + return +} + +func (p *Gender) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +type User struct { + UserID int64 `thrift:"user_id,1" form:"user_id" json:"user_id" query:"user_id"` + Name string `thrift:"name,2" form:"name" json:"name" query:"name"` + Gender Gender `thrift:"gender,3" form:"gender" json:"gender" query:"gender"` + Age int64 `thrift:"age,4" form:"age" json:"age" query:"age"` + Introduce string `thrift:"introduce,5" form:"introduce" json:"introduce" query:"introduce"` +} + +func NewUser() *User { + return &User{} +} + +func (p *User) InitDefault() { +} + +func (p *User) GetUserID() (v int64) { + return p.UserID +} + +func (p *User) GetName() (v string) { + return p.Name +} + +func (p *User) GetGender() (v Gender) { + return p.Gender +} + +func (p *User) GetAge() (v int64) { + return p.Age +} + +func (p *User) GetIntroduce() (v string) { + return p.Introduce +} + +var fieldIDToName_User = map[int16]string{ + 1: "user_id", + 2: "name", + 3: "gender", + 4: "age", + 5: "introduce", +} + +func (p *User) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.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.I64 { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_User[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *User) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UserID = _field + return nil +} +func (p *User) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *User) ReadField3(iprot thrift.TProtocol) error { + + var _field Gender + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = Gender(v) + } + p.Gender = _field + return nil +} +func (p *User) ReadField4(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Age = _field + return nil +} +func (p *User) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Introduce = _field + return nil +} + +func (p *User) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("User"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *User) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UserID); 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 *User) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); 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 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *User) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("gender", thrift.I32, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(p.Gender)); 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 *User) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("age", thrift.I64, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Age); 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 *User) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("introduce", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Introduce); 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 *User) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("User(%+v)", *p) + +} + +type CreateUserRequest struct { + Name string `thrift:"name,1" form:"name" form:"name" json:"name" vd:"(len($) > 0 && len($) < 100)"` + Gender Gender `thrift:"gender,2" form:"gender" json:"gender" vd:"($ == 1||$ == 2)"` + Age int64 `thrift:"age,3" form:"age" json:"age" vd:"$>0"` + Introduce string `thrift:"introduce,4" form:"introduce" json:"introduce" vd:"(len($) > 0 && len($) < 1000)"` +} + +func NewCreateUserRequest() *CreateUserRequest { + return &CreateUserRequest{} +} + +func (p *CreateUserRequest) InitDefault() { +} + +func (p *CreateUserRequest) GetName() (v string) { + return p.Name +} + +func (p *CreateUserRequest) GetGender() (v Gender) { + return p.Gender +} + +func (p *CreateUserRequest) GetAge() (v int64) { + return p.Age +} + +func (p *CreateUserRequest) GetIntroduce() (v string) { + return p.Introduce +} + +var fieldIDToName_CreateUserRequest = map[int16]string{ + 1: "name", + 2: "gender", + 3: "age", + 4: "introduce", +} + +func (p *CreateUserRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.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.I64 { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CreateUserRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CreateUserRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *CreateUserRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field Gender + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = Gender(v) + } + p.Gender = _field + return nil +} +func (p *CreateUserRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Age = _field + return nil +} +func (p *CreateUserRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Introduce = _field + return nil +} + +func (p *CreateUserRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateUserRequest"); 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 *CreateUserRequest) 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 *CreateUserRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("gender", thrift.I32, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(p.Gender)); 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 *CreateUserRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("age", thrift.I64, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Age); 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 *CreateUserRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("introduce", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Introduce); 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 *CreateUserRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateUserRequest(%+v)", *p) + +} + +type CreateUserResponse struct { + Code Code `thrift:"code,1" form:"code" json:"code"` + Msg string `thrift:"msg,2" form:"msg" json:"msg"` +} + +func NewCreateUserResponse() *CreateUserResponse { + return &CreateUserResponse{} +} + +func (p *CreateUserResponse) InitDefault() { +} + +func (p *CreateUserResponse) GetCode() (v Code) { + return p.Code +} + +func (p *CreateUserResponse) GetMsg() (v string) { + return p.Msg +} + +var fieldIDToName_CreateUserResponse = map[int16]string{ + 1: "code", + 2: "msg", +} + +func (p *CreateUserResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CreateUserResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CreateUserResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field Code + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = Code(v) + } + p.Code = _field + return nil +} +func (p *CreateUserResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Msg = _field + return nil +} + +func (p *CreateUserResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateUserResponse"); 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 *CreateUserResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(p.Code)); 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 *CreateUserResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Msg); 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 *CreateUserResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateUserResponse(%+v)", *p) + +} + +type QueryUserRequest struct { + Keyword *string `thrift:"Keyword,1,optional" form:"keyword" form:"keyword" json:"keyword,omitempty" query:"keyword"` + Page int64 `thrift:"page,2" form:"page" json:"page" query:"page" vd:"$ > 0"` + PageSize int64 `thrift:"page_size,3" form:"page_size" json:"page_size" query:"page_size" vd:"($ > 0 || $ <= 100)"` +} + +func NewQueryUserRequest() *QueryUserRequest { + return &QueryUserRequest{} +} + +func (p *QueryUserRequest) InitDefault() { +} + +var QueryUserRequest_Keyword_DEFAULT string + +func (p *QueryUserRequest) GetKeyword() (v string) { + if !p.IsSetKeyword() { + return QueryUserRequest_Keyword_DEFAULT + } + return *p.Keyword +} + +func (p *QueryUserRequest) GetPage() (v int64) { + return p.Page +} + +func (p *QueryUserRequest) GetPageSize() (v int64) { + return p.PageSize +} + +var fieldIDToName_QueryUserRequest = map[int16]string{ + 1: "Keyword", + 2: "page", + 3: "page_size", +} + +func (p *QueryUserRequest) IsSetKeyword() bool { + return p.Keyword != nil +} + +func (p *QueryUserRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.I64 { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_QueryUserRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *QueryUserRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Keyword = _field + return nil +} +func (p *QueryUserRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Page = _field + return nil +} +func (p *QueryUserRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PageSize = _field + return nil +} + +func (p *QueryUserRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("QueryUserRequest"); 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 *QueryUserRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetKeyword() { + if err = oprot.WriteFieldBegin("Keyword", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Keyword); 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 *QueryUserRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("page", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Page); 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 *QueryUserRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("page_size", thrift.I64, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PageSize); 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 *QueryUserRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryUserRequest(%+v)", *p) + +} + +type QueryUserResponse struct { + Code Code `thrift:"code,1" form:"code" json:"code"` + Msg string `thrift:"msg,2" form:"msg" json:"msg"` + Users []*User `thrift:"users,3" form:"users" json:"users"` + Total int64 `thrift:"total,4" form:"total" json:"total"` +} + +func NewQueryUserResponse() *QueryUserResponse { + return &QueryUserResponse{} +} + +func (p *QueryUserResponse) InitDefault() { +} + +func (p *QueryUserResponse) GetCode() (v Code) { + return p.Code +} + +func (p *QueryUserResponse) GetMsg() (v string) { + return p.Msg +} + +func (p *QueryUserResponse) GetUsers() (v []*User) { + return p.Users +} + +func (p *QueryUserResponse) GetTotal() (v int64) { + return p.Total +} + +var fieldIDToName_QueryUserResponse = map[int16]string{ + 1: "code", + 2: "msg", + 3: "users", + 4: "total", +} + +func (p *QueryUserResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.LIST { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.I64 { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_QueryUserResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *QueryUserResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field Code + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = Code(v) + } + p.Code = _field + return nil +} +func (p *QueryUserResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Msg = _field + return nil +} +func (p *QueryUserResponse) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*User, 0, size) + values := make([]User, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Users = _field + return nil +} +func (p *QueryUserResponse) ReadField4(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Total = _field + return nil +} + +func (p *QueryUserResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("QueryUserResponse"); 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 *QueryUserResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(p.Code)); 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 *QueryUserResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Msg); 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 *QueryUserResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("users", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Users)); err != nil { + return err + } + for _, v := range p.Users { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *QueryUserResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("total", thrift.I64, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(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 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *QueryUserResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryUserResponse(%+v)", *p) + +} + +type DeleteUserRequest struct { + // user id + UserID int64 `thrift:"user_id,1" json:"user_id" path:"user_id" vd:"$>0"` +} + +func NewDeleteUserRequest() *DeleteUserRequest { + return &DeleteUserRequest{} +} + +func (p *DeleteUserRequest) InitDefault() { +} + +func (p *DeleteUserRequest) GetUserID() (v int64) { + return p.UserID +} + +var fieldIDToName_DeleteUserRequest = map[int16]string{ + 1: "user_id", +} + +func (p *DeleteUserRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DeleteUserRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *DeleteUserRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UserID = _field + return nil +} + +func (p *DeleteUserRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DeleteUserRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *DeleteUserRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UserID); 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 *DeleteUserRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteUserRequest(%+v)", *p) + +} + +type DeleteUserResponse struct { + Code Code `thrift:"code,1" form:"code" json:"code"` + Msg string `thrift:"msg,2" form:"msg" json:"msg"` +} + +func NewDeleteUserResponse() *DeleteUserResponse { + return &DeleteUserResponse{} +} + +func (p *DeleteUserResponse) InitDefault() { +} + +func (p *DeleteUserResponse) GetCode() (v Code) { + return p.Code +} + +func (p *DeleteUserResponse) GetMsg() (v string) { + return p.Msg +} + +var fieldIDToName_DeleteUserResponse = map[int16]string{ + 1: "code", + 2: "msg", +} + +func (p *DeleteUserResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DeleteUserResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *DeleteUserResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field Code + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = Code(v) + } + p.Code = _field + return nil +} +func (p *DeleteUserResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Msg = _field + return nil +} + +func (p *DeleteUserResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DeleteUserResponse"); 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 *DeleteUserResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(p.Code)); 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 *DeleteUserResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Msg); 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 *DeleteUserResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteUserResponse(%+v)", *p) + +} + +type UpdateUserRequest struct { + UserID int64 `thrift:"user_id,1" json:"user_id" path:"user_id" vd:"$>0"` + Name string `thrift:"name,2" form:"name" json:"name" vd:"(len($) > 0 && len($) < 100)"` + Gender Gender `thrift:"gender,3" form:"gender" json:"gender" vd:"($ == 1||$ == 2)"` + Age int64 `thrift:"age,4" form:"age" json:"age" vd:"$>0"` + Introduce string `thrift:"introduce,5" form:"introduce" form:"introduce" json:"introduce" vd:"(len($) > 0 && len($) < 1000)"` +} + +func NewUpdateUserRequest() *UpdateUserRequest { + return &UpdateUserRequest{} +} + +func (p *UpdateUserRequest) InitDefault() { +} + +func (p *UpdateUserRequest) GetUserID() (v int64) { + return p.UserID +} + +func (p *UpdateUserRequest) GetName() (v string) { + return p.Name +} + +func (p *UpdateUserRequest) GetGender() (v Gender) { + return p.Gender +} + +func (p *UpdateUserRequest) GetAge() (v int64) { + return p.Age +} + +func (p *UpdateUserRequest) GetIntroduce() (v string) { + return p.Introduce +} + +var fieldIDToName_UpdateUserRequest = map[int16]string{ + 1: "user_id", + 2: "name", + 3: "gender", + 4: "age", + 5: "introduce", +} + +func (p *UpdateUserRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.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.I64 { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UpdateUserRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UpdateUserRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UserID = _field + return nil +} +func (p *UpdateUserRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *UpdateUserRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field Gender + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = Gender(v) + } + p.Gender = _field + return nil +} +func (p *UpdateUserRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Age = _field + return nil +} +func (p *UpdateUserRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Introduce = _field + return nil +} + +func (p *UpdateUserRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("UpdateUserRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *UpdateUserRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UserID); 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 *UpdateUserRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); 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 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *UpdateUserRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("gender", thrift.I32, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(p.Gender)); 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 *UpdateUserRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("age", thrift.I64, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Age); 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 *UpdateUserRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("introduce", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Introduce); 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 *UpdateUserRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateUserRequest(%+v)", *p) + +} + +type UpdateUserResponse struct { + Code Code `thrift:"code,1" form:"code" json:"code"` + Msg string `thrift:"msg,2" form:"msg" json:"msg"` +} + +func NewUpdateUserResponse() *UpdateUserResponse { + return &UpdateUserResponse{} +} + +func (p *UpdateUserResponse) InitDefault() { +} + +func (p *UpdateUserResponse) GetCode() (v Code) { + return p.Code +} + +func (p *UpdateUserResponse) GetMsg() (v string) { + return p.Msg +} + +var fieldIDToName_UpdateUserResponse = map[int16]string{ + 1: "code", + 2: "msg", +} + +func (p *UpdateUserResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UpdateUserResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UpdateUserResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field Code + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = Code(v) + } + p.Code = _field + return nil +} +func (p *UpdateUserResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Msg = _field + return nil +} + +func (p *UpdateUserResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("UpdateUserResponse"); 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 *UpdateUserResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(p.Code)); 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 *UpdateUserResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Msg); 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 *UpdateUserResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateUserResponse(%+v)", *p) + +} + +// user service description +type UserService interface { + UpdateUser(ctx context.Context, req *UpdateUserRequest) (r *UpdateUserResponse, err error) + + DeleteUser(ctx context.Context, req *DeleteUserRequest) (r *DeleteUserResponse, err error) + + QueryUser(ctx context.Context, req *QueryUserRequest) (r *QueryUserResponse, err error) + + CreateUser(ctx context.Context, req *CreateUserRequest) (r *CreateUserResponse, err error) +} + +type UserServiceClient struct { + c thrift.TClient +} + +func NewUserServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *UserServiceClient { + return &UserServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewUserServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *UserServiceClient { + return &UserServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewUserServiceClient(c thrift.TClient) *UserServiceClient { + return &UserServiceClient{ + c: c, + } +} + +func (p *UserServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *UserServiceClient) UpdateUser(ctx context.Context, req *UpdateUserRequest) (r *UpdateUserResponse, err error) { + var _args UserServiceUpdateUserArgs + _args.Req = req + var _result UserServiceUpdateUserResult + if err = p.Client_().Call(ctx, "UpdateUser", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *UserServiceClient) DeleteUser(ctx context.Context, req *DeleteUserRequest) (r *DeleteUserResponse, err error) { + var _args UserServiceDeleteUserArgs + _args.Req = req + var _result UserServiceDeleteUserResult + if err = p.Client_().Call(ctx, "DeleteUser", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *UserServiceClient) QueryUser(ctx context.Context, req *QueryUserRequest) (r *QueryUserResponse, err error) { + var _args UserServiceQueryUserArgs + _args.Req = req + var _result UserServiceQueryUserResult + if err = p.Client_().Call(ctx, "QueryUser", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *UserServiceClient) CreateUser(ctx context.Context, req *CreateUserRequest) (r *CreateUserResponse, err error) { + var _args UserServiceCreateUserArgs + _args.Req = req + var _result UserServiceCreateUserResult + if err = p.Client_().Call(ctx, "CreateUser", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +type UserServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler UserService +} + +func (p *UserServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *UserServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *UserServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewUserServiceProcessor(handler UserService) *UserServiceProcessor { + self := &UserServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("UpdateUser", &userServiceProcessorUpdateUser{handler: handler}) + self.AddToProcessorMap("DeleteUser", &userServiceProcessorDeleteUser{handler: handler}) + self.AddToProcessorMap("QueryUser", &userServiceProcessorQueryUser{handler: handler}) + self.AddToProcessorMap("CreateUser", &userServiceProcessorCreateUser{handler: handler}) + return self +} +func (p *UserServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x +} + +type userServiceProcessorUpdateUser struct { + handler UserService +} + +func (p *userServiceProcessorUpdateUser) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceUpdateUserArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("UpdateUser", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := UserServiceUpdateUserResult{} + var retval *UpdateUserResponse + if retval, err2 = p.handler.UpdateUser(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UpdateUser: "+err2.Error()) + oprot.WriteMessageBegin("UpdateUser", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("UpdateUser", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type userServiceProcessorDeleteUser struct { + handler UserService +} + +func (p *userServiceProcessorDeleteUser) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceDeleteUserArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("DeleteUser", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := UserServiceDeleteUserResult{} + var retval *DeleteUserResponse + if retval, err2 = p.handler.DeleteUser(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DeleteUser: "+err2.Error()) + oprot.WriteMessageBegin("DeleteUser", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("DeleteUser", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type userServiceProcessorQueryUser struct { + handler UserService +} + +func (p *userServiceProcessorQueryUser) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceQueryUserArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("QueryUser", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := UserServiceQueryUserResult{} + var retval *QueryUserResponse + if retval, err2 = p.handler.QueryUser(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing QueryUser: "+err2.Error()) + oprot.WriteMessageBegin("QueryUser", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("QueryUser", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type userServiceProcessorCreateUser struct { + handler UserService +} + +func (p *userServiceProcessorCreateUser) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceCreateUserArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("CreateUser", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := UserServiceCreateUserResult{} + var retval *CreateUserResponse + if retval, err2 = p.handler.CreateUser(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CreateUser: "+err2.Error()) + oprot.WriteMessageBegin("CreateUser", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("CreateUser", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type UserServiceUpdateUserArgs struct { + Req *UpdateUserRequest `thrift:"req,1"` +} + +func NewUserServiceUpdateUserArgs() *UserServiceUpdateUserArgs { + return &UserServiceUpdateUserArgs{} +} + +func (p *UserServiceUpdateUserArgs) InitDefault() { +} + +var UserServiceUpdateUserArgs_Req_DEFAULT *UpdateUserRequest + +func (p *UserServiceUpdateUserArgs) GetReq() (v *UpdateUserRequest) { + if !p.IsSetReq() { + return UserServiceUpdateUserArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_UserServiceUpdateUserArgs = map[int16]string{ + 1: "req", +} + +func (p *UserServiceUpdateUserArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *UserServiceUpdateUserArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceUpdateUserArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UserServiceUpdateUserArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewUpdateUserRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *UserServiceUpdateUserArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("UpdateUser_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *UserServiceUpdateUserArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *UserServiceUpdateUserArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceUpdateUserArgs(%+v)", *p) + +} + +type UserServiceUpdateUserResult struct { + Success *UpdateUserResponse `thrift:"success,0,optional"` +} + +func NewUserServiceUpdateUserResult() *UserServiceUpdateUserResult { + return &UserServiceUpdateUserResult{} +} + +func (p *UserServiceUpdateUserResult) InitDefault() { +} + +var UserServiceUpdateUserResult_Success_DEFAULT *UpdateUserResponse + +func (p *UserServiceUpdateUserResult) GetSuccess() (v *UpdateUserResponse) { + if !p.IsSetSuccess() { + return UserServiceUpdateUserResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_UserServiceUpdateUserResult = map[int16]string{ + 0: "success", +} + +func (p *UserServiceUpdateUserResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *UserServiceUpdateUserResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceUpdateUserResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UserServiceUpdateUserResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewUpdateUserResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *UserServiceUpdateUserResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("UpdateUser_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + 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 *UserServiceUpdateUserResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.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 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *UserServiceUpdateUserResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceUpdateUserResult(%+v)", *p) + +} + +type UserServiceDeleteUserArgs struct { + Req *DeleteUserRequest `thrift:"req,1"` +} + +func NewUserServiceDeleteUserArgs() *UserServiceDeleteUserArgs { + return &UserServiceDeleteUserArgs{} +} + +func (p *UserServiceDeleteUserArgs) InitDefault() { +} + +var UserServiceDeleteUserArgs_Req_DEFAULT *DeleteUserRequest + +func (p *UserServiceDeleteUserArgs) GetReq() (v *DeleteUserRequest) { + if !p.IsSetReq() { + return UserServiceDeleteUserArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_UserServiceDeleteUserArgs = map[int16]string{ + 1: "req", +} + +func (p *UserServiceDeleteUserArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *UserServiceDeleteUserArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceDeleteUserArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UserServiceDeleteUserArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDeleteUserRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *UserServiceDeleteUserArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DeleteUser_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *UserServiceDeleteUserArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *UserServiceDeleteUserArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceDeleteUserArgs(%+v)", *p) + +} + +type UserServiceDeleteUserResult struct { + Success *DeleteUserResponse `thrift:"success,0,optional"` +} + +func NewUserServiceDeleteUserResult() *UserServiceDeleteUserResult { + return &UserServiceDeleteUserResult{} +} + +func (p *UserServiceDeleteUserResult) InitDefault() { +} + +var UserServiceDeleteUserResult_Success_DEFAULT *DeleteUserResponse + +func (p *UserServiceDeleteUserResult) GetSuccess() (v *DeleteUserResponse) { + if !p.IsSetSuccess() { + return UserServiceDeleteUserResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_UserServiceDeleteUserResult = map[int16]string{ + 0: "success", +} + +func (p *UserServiceDeleteUserResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *UserServiceDeleteUserResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceDeleteUserResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UserServiceDeleteUserResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDeleteUserResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *UserServiceDeleteUserResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DeleteUser_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + 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 *UserServiceDeleteUserResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.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 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *UserServiceDeleteUserResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceDeleteUserResult(%+v)", *p) + +} + +type UserServiceQueryUserArgs struct { + Req *QueryUserRequest `thrift:"req,1"` +} + +func NewUserServiceQueryUserArgs() *UserServiceQueryUserArgs { + return &UserServiceQueryUserArgs{} +} + +func (p *UserServiceQueryUserArgs) InitDefault() { +} + +var UserServiceQueryUserArgs_Req_DEFAULT *QueryUserRequest + +func (p *UserServiceQueryUserArgs) GetReq() (v *QueryUserRequest) { + if !p.IsSetReq() { + return UserServiceQueryUserArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_UserServiceQueryUserArgs = map[int16]string{ + 1: "req", +} + +func (p *UserServiceQueryUserArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *UserServiceQueryUserArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceQueryUserArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UserServiceQueryUserArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewQueryUserRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *UserServiceQueryUserArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("QueryUser_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *UserServiceQueryUserArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *UserServiceQueryUserArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceQueryUserArgs(%+v)", *p) + +} + +type UserServiceQueryUserResult struct { + Success *QueryUserResponse `thrift:"success,0,optional"` +} + +func NewUserServiceQueryUserResult() *UserServiceQueryUserResult { + return &UserServiceQueryUserResult{} +} + +func (p *UserServiceQueryUserResult) InitDefault() { +} + +var UserServiceQueryUserResult_Success_DEFAULT *QueryUserResponse + +func (p *UserServiceQueryUserResult) GetSuccess() (v *QueryUserResponse) { + if !p.IsSetSuccess() { + return UserServiceQueryUserResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_UserServiceQueryUserResult = map[int16]string{ + 0: "success", +} + +func (p *UserServiceQueryUserResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *UserServiceQueryUserResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceQueryUserResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UserServiceQueryUserResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewQueryUserResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *UserServiceQueryUserResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("QueryUser_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + 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 *UserServiceQueryUserResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.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 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *UserServiceQueryUserResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceQueryUserResult(%+v)", *p) + +} + +type UserServiceCreateUserArgs struct { + Req *CreateUserRequest `thrift:"req,1"` +} + +func NewUserServiceCreateUserArgs() *UserServiceCreateUserArgs { + return &UserServiceCreateUserArgs{} +} + +func (p *UserServiceCreateUserArgs) InitDefault() { +} + +var UserServiceCreateUserArgs_Req_DEFAULT *CreateUserRequest + +func (p *UserServiceCreateUserArgs) GetReq() (v *CreateUserRequest) { + if !p.IsSetReq() { + return UserServiceCreateUserArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_UserServiceCreateUserArgs = map[int16]string{ + 1: "req", +} + +func (p *UserServiceCreateUserArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *UserServiceCreateUserArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceCreateUserArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UserServiceCreateUserArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewCreateUserRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *UserServiceCreateUserArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateUser_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *UserServiceCreateUserArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *UserServiceCreateUserArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceCreateUserArgs(%+v)", *p) + +} + +type UserServiceCreateUserResult struct { + Success *CreateUserResponse `thrift:"success,0,optional"` +} + +func NewUserServiceCreateUserResult() *UserServiceCreateUserResult { + return &UserServiceCreateUserResult{} +} + +func (p *UserServiceCreateUserResult) InitDefault() { +} + +var UserServiceCreateUserResult_Success_DEFAULT *CreateUserResponse + +func (p *UserServiceCreateUserResult) GetSuccess() (v *CreateUserResponse) { + if !p.IsSetSuccess() { + return UserServiceCreateUserResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_UserServiceCreateUserResult = map[int16]string{ + 0: "success", +} + +func (p *UserServiceCreateUserResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *UserServiceCreateUserResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceCreateUserResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UserServiceCreateUserResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewCreateUserResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *UserServiceCreateUserResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateUser_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + 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 *UserServiceCreateUserResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.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 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *UserServiceCreateUserResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceCreateUserResult(%+v)", *p) + +} diff --git a/bizdemo/hertz_swagger_gen/biz/model/sql/user.sql b/bizdemo/hertz_swagger_gen/biz/model/sql/user.sql new file mode 100644 index 00000000..ef528afb --- /dev/null +++ b/bizdemo/hertz_swagger_gen/biz/model/sql/user.sql @@ -0,0 +1,13 @@ +CREATE TABLE `users` +( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'PK', + `name` varchar(128) NOT NULL DEFAULT '' COMMENT 'User name', + `gender` int(8) NOT NULL DEFAULT 0 COMMENT 'User gender', + `age` int(64) NOT NULL DEFAULT 0 COMMENT 'User age', + `introduce` Text NULL COMMENT 'User introduce', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'User information create time', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'User information update time', + `deleted_at` timestamp NULL DEFAULT NULL COMMENT 'User information delete time', + PRIMARY KEY (`id`), + KEY `idx_name` (`name`,`deleted_at`) COMMENT 'User name index' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='User information table' \ No newline at end of file diff --git a/bizdemo/hertz_swagger_gen/biz/model/user.go b/bizdemo/hertz_swagger_gen/biz/model/user.go new file mode 100644 index 00000000..228ff35b --- /dev/null +++ b/bizdemo/hertz_swagger_gen/biz/model/user.go @@ -0,0 +1,31 @@ +/* + * Copyright 2024 CloudWeGo Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package model + +import "gorm.io/gorm" + +type User struct { + gorm.Model + Name string `json:"name" column:"name"` + Gender int64 `json:"gender" column:"gender"` + Age int64 `json:"age" column:"age"` + Introduce string `json:"introduce" column:"introduce"` +} + +func (u *User) TableName() string { + return "users" +} diff --git a/bizdemo/hertz_swagger_gen/biz/pack/user.go b/bizdemo/hertz_swagger_gen/biz/pack/user.go new file mode 100644 index 00000000..b47d6aef --- /dev/null +++ b/bizdemo/hertz_swagger_gen/biz/pack/user.go @@ -0,0 +1,47 @@ +/* + * Copyright 2024 CloudWeGo Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package pack + +import ( + "github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen/biz/hertz_gen/user" + "github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen/biz/model" +) + +// Users Convert model.User list to user_gorm.User list +func Users(models []*model.User) []*user.User { + users := make([]*user.User, 0, len(models)) + for _, m := range models { + if u := User(m); u != nil { + users = append(users, u) + } + } + return users +} + +// User Convert model.User to user_gorm.User +func User(model *model.User) *user.User { + if model == nil { + return nil + } + return &user.User{ + UserID: int64(model.ID), + Name: model.Name, + Gender: user.Gender(model.Gender), + Age: model.Age, + Introduce: model.Introduce, + } +} diff --git a/bizdemo/hertz_swagger_gen/biz/router/register.go b/bizdemo/hertz_swagger_gen/biz/router/register.go new file mode 100644 index 00000000..442090ed --- /dev/null +++ b/bizdemo/hertz_swagger_gen/biz/router/register.go @@ -0,0 +1,14 @@ +// Code generated by hertz generator. DO NOT EDIT. + +package router + +import ( + user "github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen/biz/router/user" + "github.com/cloudwego/hertz/pkg/app/server" +) + +// GeneratedRegister registers routers generated by IDL. +func GeneratedRegister(r *server.Hertz) { + //INSERT_POINT: DO NOT DELETE THIS LINE! + user.Register(r) +} diff --git a/bizdemo/hertz_swagger_gen/biz/router/user/middleware.go b/bizdemo/hertz_swagger_gen/biz/router/user/middleware.go new file mode 100644 index 00000000..67abd2ca --- /dev/null +++ b/bizdemo/hertz_swagger_gen/biz/router/user/middleware.go @@ -0,0 +1,62 @@ +// Code generated by hertz generator. + +package user + +import ( + "github.com/cloudwego/hertz/pkg/app" +) + +func rootMw() []app.HandlerFunc { + // your code... + return nil +} + +func _v1Mw() []app.HandlerFunc { + // your code... + return nil +} + +func _userMw() []app.HandlerFunc { + // your code... + return nil +} + +func _createMw() []app.HandlerFunc { + // your code... + return nil +} + +func _createuserMw() []app.HandlerFunc { + // your code... + return nil +} + +func _deleteMw() []app.HandlerFunc { + // your code... + return nil +} + +func _deleteuserMw() []app.HandlerFunc { + // your code... + return nil +} + +func _queryMw() []app.HandlerFunc { + // your code... + return nil +} + +func _queryuserMw() []app.HandlerFunc { + // your code... + return nil +} + +func _updateMw() []app.HandlerFunc { + // your code... + return nil +} + +func _updateuserMw() []app.HandlerFunc { + // your code... + return nil +} diff --git a/bizdemo/hertz_swagger_gen/biz/router/user/user.go b/bizdemo/hertz_swagger_gen/biz/router/user/user.go new file mode 100644 index 00000000..8ee640fc --- /dev/null +++ b/bizdemo/hertz_swagger_gen/biz/router/user/user.go @@ -0,0 +1,42 @@ +// Code generated by hertz generator. DO NOT EDIT. + +package user + +import ( + user "github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen/biz/handler/user" + "github.com/cloudwego/hertz/pkg/app/server" +) + +/* + This file will register all the routes of the services in the master idl. + And it will update automatically when you use the "update" command for the idl. + So don't modify the contents of the file, or your code will be deleted when it is updated. +*/ + +// Register register routes based on the IDL 'api.${HTTP Method}' annotation. +func Register(r *server.Hertz) { + + root := r.Group("/", rootMw()...) + { + _v1 := root.Group("/v1", _v1Mw()...) + { + _user := _v1.Group("/user", _userMw()...) + { + _create := _user.Group("/create", _createMw()...) + _create.POST("/", append(_createuserMw(), user.CreateUser)...) + } + { + _delete := _user.Group("/delete", _deleteMw()...) + _delete.POST("/:user_id", append(_deleteuserMw(), user.DeleteUser)...) + } + { + _query := _user.Group("/query", _queryMw()...) + _query.POST("/", append(_queryuserMw(), user.QueryUser)...) + } + { + _update := _user.Group("/update", _updateMw()...) + _update.POST("/:user_id", append(_updateuserMw(), user.UpdateUser)...) + } + } + } +} diff --git a/bizdemo/hertz_swagger_gen/build.sh b/bizdemo/hertz_swagger_gen/build.sh new file mode 100755 index 00000000..f1ba589c --- /dev/null +++ b/bizdemo/hertz_swagger_gen/build.sh @@ -0,0 +1,6 @@ +#!/bin/bash +RUN_NAME=hertz_service +mkdir -p output/bin +cp script/* output 2>/dev/null +chmod +x output/bootstrap.sh +go build -o output/bin/${RUN_NAME} \ No newline at end of file diff --git a/bizdemo/hertz_swagger_gen/go.mod b/bizdemo/hertz_swagger_gen/go.mod new file mode 100755 index 00000000..5367fa15 --- /dev/null +++ b/bizdemo/hertz_swagger_gen/go.mod @@ -0,0 +1,53 @@ +module github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen + +go 1.21 + +replace github.com/apache/thrift => github.com/apache/thrift v0.13.0 + +require ( + github.com/apache/thrift v0.16.0 + github.com/cloudwego/hertz v0.9.3 + github.com/hertz-contrib/cors v0.1.0 + github.com/hertz-contrib/swagger v0.1.0 + github.com/swaggo/files v1.0.1 + gorm.io/driver/mysql v1.5.7 + gorm.io/gorm v1.25.12 +) + +require ( + github.com/KyleBanks/depth v1.2.1 // indirect + github.com/bytedance/go-tagexpr/v2 v2.9.2 // indirect + github.com/bytedance/gopkg v0.1.0 // indirect + github.com/bytedance/sonic v1.12.0 // indirect + github.com/bytedance/sonic/loader v0.2.0 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/cloudwego/netpoll v0.6.2 // indirect + github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/go-openapi/jsonpointer v0.20.0 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/spec v0.20.9 // indirect + github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-sql-driver/mysql v1.7.0 // indirect + github.com/golang/protobuf v1.5.0 // indirect + github.com/henrylee2cn/ameda v1.4.10 // indirect + github.com/henrylee2cn/goutil v0.0.0-20210127050712-89660552f6f8 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/klauspost/cpuid/v2 v2.0.9 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/nyaruka/phonenumbers v1.0.55 // indirect + github.com/swaggo/swag v1.16.1 // indirect + github.com/tidwall/gjson v1.14.4 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect + golang.org/x/net v0.12.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/tools v0.11.0 // indirect + google.golang.org/protobuf v1.27.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/bizdemo/hertz_swagger_gen/go.sum b/bizdemo/hertz_swagger_gen/go.sum new file mode 100644 index 00000000..a39e258b --- /dev/null +++ b/bizdemo/hertz_swagger_gen/go.sum @@ -0,0 +1,204 @@ +github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= +github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= +github.com/apache/thrift v0.13.0 h1:5hryIiq9gtn+MiLVn0wP37kb/uTeRZgN08WoCsAhIhI= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/bytedance/go-tagexpr/v2 v2.9.2 h1:QySJaAIQgOEDQBLS3x9BxOWrnhqu5sQ+f6HaZIxD39I= +github.com/bytedance/go-tagexpr/v2 v2.9.2/go.mod h1:5qsx05dYOiUXOUgnQ7w3Oz8BYs2qtM/bJokdLb79wRM= +github.com/bytedance/gopkg v0.0.0-20220413063733-65bf48ffb3a7/go.mod h1:2ZlV9BaUH4+NXIBF0aMdKKAnHTzqH+iMU4KUjAbL23Q= +github.com/bytedance/gopkg v0.0.0-20240507064146-197ded923ae3/go.mod h1:FtQG3YbQG9L/91pbKSw787yBQPutC+457AvDW77fgUQ= +github.com/bytedance/gopkg v0.1.0 h1:aAxB7mm1qms4Wz4sp8e1AtKDOeFLtdqvGiUe7aonRJs= +github.com/bytedance/gopkg v0.1.0/go.mod h1:FtQG3YbQG9L/91pbKSw787yBQPutC+457AvDW77fgUQ= +github.com/bytedance/mockey v1.2.1/go.mod h1:+Jm/fzWZAuhEDrPXVjDf/jLM2BlLXJkwk94zf2JZ3X4= +github.com/bytedance/mockey v1.2.12 h1:aeszOmGw8CPX8CRx1DZ/Glzb1yXvhjDh6jdFBNZjsU4= +github.com/bytedance/mockey v1.2.12/go.mod h1:3ZA4MQasmqC87Tw0w7Ygdy7eHIc2xgpZ8Pona5rsYIk= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.8.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.12.0 h1:YGPgxF9xzaCNvd/ZKdQ28yRovhfMFZQjuk6fKBzZ3ls= +github.com/bytedance/sonic v1.12.0/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= +github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/hertz v0.6.2/go.mod h1:2em2hGREvCBawsTQcQxyWBGVlCeo+N1pp2q0HkkbwR0= +github.com/cloudwego/hertz v0.9.3 h1:uajvLn6LjEPjUqN/ewUZtWoRQWa2es2XTELdqDlOYMw= +github.com/cloudwego/hertz v0.9.3/go.mod h1:gGVUfJU/BOkJv/ZTzrw7FS7uy7171JeYIZvAyV3wS3o= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= +github.com/cloudwego/netpoll v0.3.1/go.mod h1:1T2WVuQ+MQw6h6DpE45MohSvDTKdy2DlzCx2KsnPI4E= +github.com/cloudwego/netpoll v0.6.2 h1:+KdILv5ATJU+222wNNXpHapYaBeRvvL8qhJyhcxRxrQ= +github.com/cloudwego/netpoll v0.6.2/go.mod h1:kaqvfZ70qd4T2WtIIpCOi5Cxyob8viEpzLhCrTrz3HM= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= +github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/spec v0.20.9 h1:xnlYNQAwKd2VQRRfwTEI0DcK+2cbuvI/0c7jx3gA8/8= +github.com/go-openapi/spec v0.20.9/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= +github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/henrylee2cn/ameda v1.4.8/go.mod h1:liZulR8DgHxdK+MEwvZIylGnmcjzQ6N6f2PlWe7nEO4= +github.com/henrylee2cn/ameda v1.4.10 h1:JdvI2Ekq7tapdPsuhrc4CaFiqw6QXFvZIULWJgQyCAk= +github.com/henrylee2cn/ameda v1.4.10/go.mod h1:liZulR8DgHxdK+MEwvZIylGnmcjzQ6N6f2PlWe7nEO4= +github.com/henrylee2cn/goutil v0.0.0-20210127050712-89660552f6f8 h1:yE9ULgp02BhYIrO6sdV/FPe0xQM6fNHkVQW2IAymfM0= +github.com/henrylee2cn/goutil v0.0.0-20210127050712-89660552f6f8/go.mod h1:Nhe/DM3671a5udlv2AdV2ni/MZzgfv2qrPL5nIi3EGQ= +github.com/hertz-contrib/cors v0.1.0 h1:PQ5mATygSMzTlYtfyMyHjobYoJeHKe2Qt3tcAOgbI6E= +github.com/hertz-contrib/cors v0.1.0/go.mod h1:VPReoq+Rvu/lZOfpp5CcX3x4mpZUc3EpSXBcVDcbvOc= +github.com/hertz-contrib/swagger v0.1.0 h1:FlnMPRHuvAt/3pt3KCQRZ6RH1g/agma9SU70Op2Pb58= +github.com/hertz-contrib/swagger v0.1.0/go.mod h1:Bt5i+Nyo7bGmYbuEfMArx7raf1oK+nWVgYbEvhpICKE= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nyaruka/phonenumbers v1.0.55 h1:bj0nTO88Y68KeUQ/n3Lo2KgK7lM1hF7L9NFuwcCl3yg= +github.com/nyaruka/phonenumbers v1.0.55/go.mod h1:sDaTZ/KPX5f8qyV9qN+hIm+4ZBARJrupC6LuhshJq1U= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE= +github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg= +github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= +github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= +github.com/tidwall/gjson v1.9.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.13.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= +github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +golang.org/x/arch v0.0.0-20201008161808-52c3e6f60cff/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220110181412-a018aaa089fe/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.11.0 h1:EMCa6U9S2LtZXLAMoWiR/R8dAQFRqbAitmbJ2UKhoi8= +golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/driver/mysql v1.5.7 h1:MndhOPYOfEp2rHKgkZIhJ16eVUIRf2HmzgoPmh7FCWo= +gorm.io/driver/mysql v1.5.7/go.mod h1:sEtPWMiqiN1N1cMXoXmBbd8C6/l+TESwriotuRRpkDM= +gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= +gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8= +gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/bizdemo/hertz_swagger_gen/idl/openapi.thrift b/bizdemo/hertz_swagger_gen/idl/openapi.thrift new file mode 100644 index 00000000..dee3fbde --- /dev/null +++ b/bizdemo/hertz_swagger_gen/idl/openapi.thrift @@ -0,0 +1,562 @@ +/* + * Copyright 2024 CloudWeGo Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +namespace go openapi + +struct _ServiceOptions { + 1:required Document document +} + +struct _StructOptions { + 1:required Schema schema +} + +struct _MethodOptions { + 1:required Operation operation +} + +struct _FieldOptions { + 1:required Parameter parameter + 2:required Schema property +} + +struct AdditionalPropertiesItem { + 1: SchemaOrReference schema_or_reference, + 2: bool boolean +} + +struct Any { + 1: _Any value, + 2: string yaml +} + +struct _Any { + 1: string type_url, + 2: binary value +} + +struct AnyOrExpression { + 1: Any any, + 2: Expression expression +} + +struct Callback { + 1: list path, + 2: list specification_extension +} + +struct CallbackOrReference { + 1: Callback callback, + 2: Reference reference +} + +struct CallbacksOrReferences { + 1: list additional_properties +} + +struct Components { + 1: SchemasOrReferences schemas, + 2: ResponsesOrReferences responses, + 3: ParametersOrReferences parameters, + 4: ExamplesOrReferences examples, + 5: RequestBodiesOrReferences request_bodies, + 6: HeadersOrReferences headers, + 7: SecuritySchemesOrReferences security_schemes, + 8: LinksOrReferences links, + 9: CallbacksOrReferences callbacks, + 10: list specification_extension +} + +struct Contact { + 1: string name, + 2: string url, + 3: string email, + 4: list specification_extension +} + +struct DefaultType { + 1: double number, + 2: bool boolean, + 3: string string +} + +struct Discriminator { + 1: string property_name, + 2: Strings mapping, + 3: list specification_extension +} + +struct Document { + 1: string openapi, + 2: Info info, + 3: list servers, + 4: Paths paths, + 5: Components components, + 6: list security, + 7: list tags, + 8: ExternalDocs external_docs, + 9: list specification_extension +} + +struct Encoding { + 1: string content_type, + 2: HeadersOrReferences headers, + 3: string style, + 4: bool explode, + 5: bool allow_reserved, + 6: list specification_extension +} + +struct Encodings { + 1: list additional_properties +} + +struct Example { + 1: string summary, + 2: string description, + 3: Any value, + 4: string external_value, + 5: list specification_extension +} + +struct ExampleOrReference { + 1: Example example, + 2: Reference reference +} + +struct ExamplesOrReferences { + 1: list additional_properties +} + +struct Expression { + 1: list additional_properties +} + +struct ExternalDocs { + 1: string description, + 2: string url, + 3: list specification_extension +} + +struct Header { + 1: string description, + 2: bool required, + 3: bool deprecated, + 4: bool allow_empty_value, + 5: string style, + 6: bool explode, + 7: bool allow_reserved, + 8: SchemaOrReference schema, + 9: Any example, + 10: ExamplesOrReferences examples, + 11: MediaTypes content, + 12: list specification_extension +} + +struct HeaderOrReference { + 1: Header header, + 2: Reference reference +} + +struct HeadersOrReferences { + 1: list additional_properties +} + +struct Info { + 1: string title, + 2: string description, + 3: string terms_of_service, + 4: Contact contact, + 5: License license, + 6: string version, + 7: list specification_extension, + 8: string summary +} + +struct ItemsItem { + 1: list schema_or_reference +} + +struct License { + 1: string name, + 2: string url, + 3: list specification_extension +} + +struct Link { + 1: string operation_ref, + 2: string operation_id, + 3: AnyOrExpression parameters, + 4: AnyOrExpression request_body, + 5: string description, + 6: Server server, + 7: list specification_extension +} + +struct LinkOrReference { + 1: Link link, + 2: Reference reference +} + +struct LinksOrReferences { + 1: list additional_properties +} + +struct MediaType { + 1: SchemaOrReference schema, + 2: Any example, + 3: ExamplesOrReferences examples, + 4: Encodings encoding, + 5: list specification_extension +} + +struct MediaTypes { + 1: list additional_properties +} + +struct NamedAny { + 1: string name, + 2: Any value +} + +struct NamedCallbackOrReference { + 1: string name, + 2: CallbackOrReference value +} + +struct NamedEncoding { + 1: string name, + 2: Encoding value +} + +struct NamedExampleOrReference { + 1: string name, + 2: ExampleOrReference value +} + +struct NamedHeaderOrReference { + 1: string name, + 2: HeaderOrReference value +} + +struct NamedLinkOrReference { + 1: string name, + 2: LinkOrReference value +} + +struct NamedMediaType { + 1: string name, + 2: MediaType value +} + +struct NamedParameterOrReference { + 1: string name, + 2: ParameterOrReference value +} + +struct NamedPathItem { + 1: string name, + 2: PathItem value +} + +struct NamedRequestBodyOrReference { + 1: string name, + 2: RequestBodyOrReference value +} + +struct NamedResponseOrReference { + 1: string name, + 2: ResponseOrReference value +} + +struct NamedSchemaOrReference { + 1: string name, + 2: SchemaOrReference value +} + +struct NamedSecuritySchemeOrReference { + 1: string name, + 2: SecuritySchemeOrReference value +} + +struct NamedServerVariable { + 1: string name, + 2: ServerVariable value +} + +struct NamedString { + 1: string name, + 2: string value +} + +struct NamedStringArray { + 1: string name, + 2: StringArray value +} + +struct OauthFlow { + 1: string authorization_url, + 2: string token_url, + 3: string refresh_url, + 4: Strings scopes, + 5: list specification_extension +} + +struct OauthFlows { + 1: OauthFlow implicit, + 2: OauthFlow password, + 3: OauthFlow client_credentials, + 4: OauthFlow authorization_code, + 5: list specification_extension +} + +struct Object { + 1: list additional_properties +} + +struct Operation { + 1: list tags, + 2: string summary, + 3: string description, + 4: ExternalDocs external_docs, + 5: string operation_id, + 6: list parameters, + 7: RequestBodyOrReference request_body, + 8: Responses responses, + 9: CallbacksOrReferences callbacks, + 10: bool deprecated, + 11: list security, + 12: list servers, + 13: list specification_extension +} + +struct Parameter { + 1: string name, + 2: string in, + 3: string description, + 4: bool required, + 5: bool deprecated, + 6: bool allow_empty_value, + 7: string style, + 8: bool explode, + 9: bool allow_reserved, + 10: SchemaOrReference schema, + 11: Any example, + 12: ExamplesOrReferences examples, + 13: MediaTypes content, + 14: list specification_extension +} + +struct ParameterOrReference { + 1: Parameter parameter, + 2: Reference reference +} + +struct ParametersOrReferences { + 1: list additional_properties +} + +struct PathItem { + 1: string xref, + 2: string summary, + 3: string description, + 4: Operation get, + 5: Operation put, + 6: Operation post, + 7: Operation delete, + 8: Operation options, + 9: Operation head, + 10: Operation patch, + 11: Operation trace, + 12: list servers, + 13: list parameters, + 14: list specification_extension +} + +struct Paths { + 1: list path + 2: list specification_extension +} + +struct Properties { + 1: list additional_properties +} + +struct Reference { + 1: string xref + 2: string summary + 3: string description +} + +struct RequestBody { + 1: string description, + 2: MediaTypes content, + 3: bool required, + 4: list specification_extension +} + +struct RequestBodyOrReference { + 1: RequestBody request_body, + 2: Reference reference +} + +struct RequestBodiesOrReferences { + 1: list additional_properties +} + +struct Response { + 1: string description, + 2: HeadersOrReferences headers, + 3: MediaTypes content, + 4: LinksOrReferences links, + 5: list specification_extension +} + +struct ResponseOrReference { + 1: Response response, + 2: Reference reference +} + +struct Responses { + 1: ResponseOrReference default, + 2: list response_or_reference, + 3: list specification_extension +} + +struct ResponsesOrReferences { + 1: list additional_properties +} + +struct Schema { + 1: bool nullable, + 2: Discriminator discriminator, + 3: bool read_only, + 4: bool write_only, + 5: Xml xml, + 6: ExternalDocs external_docs, + 7: Any example, + 8: bool deprecated, + 9: string title, + 10: double multiple_of, + 11: double maximum, + 12: bool exclusive_maximum, + 13: double minimum, + 14: bool exclusive_minimum, + 15: i64 max_length, + 16: i64 min_length, + 17: string pattern, + 18: i64 max_items, + 19: i64 min_items, + 20: bool unique_items, + 21: i64 max_properties, + 22: i64 min_properties, + 23: list required, + 24: list enum, + 25: string type, + 26: list all_of, + 27: list one_of, + 28: list any_of, + 29: Schema not, + 30: ItemsItem items, + 31: Properties properties, + 32: AdditionalPropertiesItem additional_properties, + 33: DefaultType default, + 34: string description, + 35: string format, + 36: list specification_extension +} + +struct SchemaOrReference { + 1: Schema schema, + 2: Reference reference +} + +struct SchemasOrReferences { + 1: list additional_properties +} + +struct SecurityRequirement { + 1: list additional_properties +} + +struct SecurityScheme { + 1: string _type, + 2: string description, + 3: string name, + 4: string _in, + 5: string scheme, + 6: string bearer_format, + 7: OauthFlows flows, + 8: string open_id_connect_url, + 9: list specification_extension +} + +struct SecuritySchemeOrReference { + 1: SecurityScheme security_scheme, + 2: Reference reference +} + +struct SecuritySchemesOrReferences { + 1: list additional_properties +} + +struct Server { + 1: string url, + 2: string description, + 3: ServerVariables variables, + 4: list specification_extension +} + +struct ServerVariable { + 1: string _default, + 2: list enum, + 3: string description, + 4: list specification_extension +} + +struct ServerVariables { + 1: list additional_properties +} + +struct SpecificationExtension { + 1: double number, + 2: bool boolean, + 3: string string +} + +struct StringArray { + 1: list values +} + +struct Strings { + 1: list additional_properties +} + +struct Tag { + 1: string name, + 2: string description, + 3: ExternalDocs external_docs, + 4: list specification_extension +} + +struct Xml { + 1: string name, + 2: string namespace, + 3: string prefix, + 4: bool attribute, + 5: bool wrapped, + 6: list specification_extension +} \ No newline at end of file diff --git a/bizdemo/hertz_swagger_gen/idl/user.thrift b/bizdemo/hertz_swagger_gen/idl/user.thrift new file mode 100644 index 00000000..a8e3bf81 --- /dev/null +++ b/bizdemo/hertz_swagger_gen/idl/user.thrift @@ -0,0 +1,113 @@ +// refer to https://www.cloudwego.io/zh/docs/hertz/tutorials/toolkit/toolkit/ + +namespace go user +namespace py user +namespace java user + +include "openapi.thrift" + +enum Code { + Success = 1 + ParamInvalid = 2 + DBErr = 3 +} + +enum Gender { + Unknown = 0 + Male = 1 + Female = 2 +} + +struct User { + 1: i64 user_id + 2: string name + 3: Gender gender + 4: i64 age + 5: string introduce +} + +struct CreateUserRequest{ + 1: string name ( + api.body="name", + api.form="name", + api.vd="(len($) > 0 && len($) < 100)" + openapi.property = '{ + title: "user name", + max_length: 255 + }' + ) + 2: Gender gender (api.body="gender", api.form="gender",api.vd="($ == 1||$ == 2)") + 3: i64 age (api.body="age", api.form="age",api.vd="$>0") + 4: string introduce (api.body="introduce", api.form="introduce",api.vd="(len($) > 0 && len($) < 1000)") +} + +struct CreateUserResponse{ + 1: Code code (api.body="code") + 2: string msg (api.body="msg") +} + +struct QueryUserRequest{ + 1: optional string Keyword (api.body="keyword", api.form="keyword",api.query="keyword") + 2: i64 page (api.body="page", api.form="page",api.query="page",api.vd="$ > 0") + 3: i64 page_size (api.body="page_size", api.form="page_size",api.query="page_size",api.vd="($ > 0 || $ <= 100)") +}( + openapi.schema = '{ + title: "Query User request", + description: "Query User request", + required: [ + "keyword", "page", "page_size" + ] + }' + ) + +struct QueryUserResponse{ + 1: Code code (api.body="code") + 2: string msg (api.body="msg") + 3: list users ( + api.body="users" + openapi.property = '{ + title: "user name", + max_length: 255 + }' + ) + 4: i64 total (api.body="total") +} + +struct DeleteUserRequest{ + // user id + 1: i64 user_id (api.path="user_id",api.vd="$>0") +} + +struct DeleteUserResponse{ + 1: Code code (api.body="code") + 2: string msg (api.body="msg") +} + +struct UpdateUserRequest{ + 1: i64 user_id (api.path="user_id",api.vd="$>0") + 2: string name (api.body="name", api.form="name",api.vd="(len($) > 0 && len($) < 100)") + 3: Gender gender (api.body="gender", api.form="gender",api.vd="($ == 1||$ == 2)") + 4: i64 age (api.body="age", api.form="age",api.vd="$>0") + 5: string introduce (api.body="introduce", api.form="introduce",api.vd="(len($) > 0 && len($) < 1000)") +} + +struct UpdateUserResponse{ + 1: Code code (api.body="code") + 2: string msg (api.body="msg") +} + +// user service description +service UserService { + UpdateUserResponse UpdateUser(1:UpdateUserRequest req)(api.post="/v1/user/update/:user_id") + DeleteUserResponse DeleteUser(1:DeleteUserRequest req)(api.post="/v1/user/delete/:user_id") + QueryUserResponse QueryUser(1: QueryUserRequest req)(api.post="/v1/user/query/") + CreateUserResponse CreateUser(1:CreateUserRequest req)(api.post="/v1/user/create/") +}( + api.base_domain = "127.0.0.1:8888", + openapi.document = '{ + info: { + title: "hertz example swagger doc", + version: "0.0.1" + } + }' + ) \ No newline at end of file diff --git a/bizdemo/hertz_swagger_gen/main.go b/bizdemo/hertz_swagger_gen/main.go new file mode 100755 index 00000000..d414b90f --- /dev/null +++ b/bizdemo/hertz_swagger_gen/main.go @@ -0,0 +1,16 @@ +// Code generated by hertz generator. + +package main + +import ( + "github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen/biz/dal" + "github.com/cloudwego/hertz/pkg/app/server" +) + +func main() { + dal.Init() + h := server.Default() + + register(h) + h.Spin() +} diff --git a/bizdemo/hertz_swagger_gen/readme.md b/bizdemo/hertz_swagger_gen/readme.md new file mode 100644 index 00000000..fc9fa7a9 --- /dev/null +++ b/bizdemo/hertz_swagger_gen/readme.md @@ -0,0 +1,48 @@ +# hertz_swagger_gen + +## Introduction + +An example using `Hertz` and `thrift-gen-http-swagger`. + +- Defines `HTTP` interfaces using `thrift` IDL +- Generates code using `hz` +- Uses `Gorm` and `MySQL` +- Generates `swagger` files and `swagger ui` service using `thrift-gen-http-swagger` plugin + +- `/swagger` provides `swagger` files and a `swagger ui` server +- `/handler.go` contains the basic business logic for updating, adding, deleting, and querying users + +## IDL + +This example defines `HTTP` interfaces using `thrift` IDL. The specific interface definitions can be found in [user.thrift](idl/user.thrift). + +## Code Generation Tool + +This example uses `hz` to generate code. For more details on how to use `hz`, refer to the official [hz documentation](https://www.cloudwego.io/docs/hertz/tutorials/toolkit/toolkit/). + +The `hz` commands used can be found in the [Makefile](Makefile). + +## Binding and Validation + +For details on binding and validation, refer to [Binding and Validate](https://www.cloudwego.io/docs/hertz/tutorials/basic-feature/binding-and-validate/). + +## Plugin + +`thrift-gen-http-swagger` generates `swagger` documentation and `swagger ui` service through code generation. + +For more information on using the plugin, refer to [swagger-generate](https://github.com/hertz-contrib/swagger-generate). + +## How to Run + +### Run MySQL Docker + +```bash +cd bizdemo/hertz_swagger_gen && docker-compose up +``` + +### Run Example + +```bash +cd bizdemo/hertz_swagger_gen +go run . +``` \ No newline at end of file diff --git a/bizdemo/hertz_swagger_gen/readme_cn.md b/bizdemo/hertz_swagger_gen/readme_cn.md new file mode 100644 index 00000000..40a0d2a9 --- /dev/null +++ b/bizdemo/hertz_swagger_gen/readme_cn.md @@ -0,0 +1,48 @@ +# hertz_swagger_gen + +## 介绍 + +一个使用 `Hertz` 和 `thrift-gen-http-swagger` 的示例。 + +- 使用 `thrift` IDL 定义 `HTTP` 接口 +- 使用 `hz` 生成代码 +- 使用 `Gorm` and `MySQL` +- 使用 `thrift-gen-http-swagger` 插件生成 `swagger` 文件和 `swagger ui` 服务 + +- `/swagger` 提供 `swagger` 文件和 `swagger ui` 服务器 +- `/hander` 包含更新用户、添加用户、删除用户、查询用户的基础业务逻辑 + +## IDL + +该示例使用 `thrift` IDL 来定义 `HTTP` 接口。具体的接口定义在 [user.thrift](idl/user.thrift) 中。 + +## 代码生成工具 + +该示例使用 `hz` 来生成代码。`hz` 的使用可以参考 [hz](https://www.cloudwego.io/docs/hertz/tutorials/toolkit/toolkit/)。 + +使用的 `hz` 命令可以在 [Makefile](Makefile) 中找到。 + +## 绑定和验证 + +绑定和验证的使用可以参考[Binding and Validate](https://www.cloudwego.io/docs/hertz/tutorials/basic-feature/binding-and-validate/) + +## 插件 + +`thrift-gen-http-swagger` 通过代码生成的`swagger`文档和`swagger ui`服务。 + +插件的使用可参考 [swagger-generate](https://github.com/hertz-contrib/swagger-generate)。 + +## 如何运行 + +### 运行 MySQL docker + +```bash +cd bizdemo/hertz_swagger_gen && docker-compose up +``` + +### 运行示例 + +```bash +cd bizdemo/hertz_swagger_gen +go run . +``` \ No newline at end of file diff --git a/bizdemo/hertz_swagger_gen/router.go b/bizdemo/hertz_swagger_gen/router.go new file mode 100755 index 00000000..4bf2574a --- /dev/null +++ b/bizdemo/hertz_swagger_gen/router.go @@ -0,0 +1,15 @@ +// Code generated by hertz generator. + +package main + +import ( + handler "github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen/biz/handler" + "github.com/cloudwego/hertz/pkg/app/server" +) + +// customizeRegister registers customize routers. +func customizedRegister(r *server.Hertz) { + r.GET("/ping", handler.Ping) + + // your code ... +} diff --git a/bizdemo/hertz_swagger_gen/router_gen.go b/bizdemo/hertz_swagger_gen/router_gen.go new file mode 100755 index 00000000..cac2a5e9 --- /dev/null +++ b/bizdemo/hertz_swagger_gen/router_gen.go @@ -0,0 +1,18 @@ +// Code generated by hertz generator. DO NOT EDIT. + +package main + +import ( + router "github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen/biz/router" + "github.com/cloudwego/hertz-examples/bizdemo/hertz_swagger_gen/swagger" + "github.com/cloudwego/hertz/pkg/app/server" +) + +// register registers all routers. +func register(r *server.Hertz) { + swagger.BindSwagger(r) + + router.GeneratedRegister(r) + + customizedRegister(r) +} diff --git a/bizdemo/hertz_swagger_gen/script/bootstrap.sh b/bizdemo/hertz_swagger_gen/script/bootstrap.sh new file mode 100755 index 00000000..3f3fc1af --- /dev/null +++ b/bizdemo/hertz_swagger_gen/script/bootstrap.sh @@ -0,0 +1,5 @@ +#!/bin/bash +CURDIR=$(cd $(dirname $0); pwd) +BinaryName=hertz_service +echo "$CURDIR/bin/${BinaryName}" +exec $CURDIR/bin/${BinaryName} \ No newline at end of file diff --git a/bizdemo/hertz_swagger_gen/swagger/openapi.yaml b/bizdemo/hertz_swagger_gen/swagger/openapi.yaml new file mode 100644 index 00000000..3ab0e971 --- /dev/null +++ b/bizdemo/hertz_swagger_gen/swagger/openapi.yaml @@ -0,0 +1,310 @@ +# Generated with thrift-gen-http-swagger +# https://github.com/hertz-contrib/swagger-generate/thrift-gen-http-swagger + +openapi: 3.0.3 +info: + title: hertz example swagger doc + description: user service description + version: 0.0.1 +servers: + - url: http://127.0.0.1:8888 +paths: + /v1/user/create/: + post: + tags: + - UserService + operationId: UserService_CreateUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateUserRequestBody' + multipart/form-data: + schema: + $ref: '#/components/schemas/CreateUserRequestForm' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/CreateUserRequestForm' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/CreateUserResponseBody' + /v1/user/delete/{user_id}: + post: + tags: + - UserService + operationId: UserService_DeleteUser + parameters: + - name: user_id + in: path + description: user id + required: true + schema: + type: integer + format: int64 + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteUserResponseBody' + /v1/user/query/: + post: + tags: + - UserService + operationId: UserService_QueryUser + parameters: + - name: keyword + in: query + schema: + type: string + - name: page + in: query + schema: + type: integer + format: int64 + - name: page_size + in: query + schema: + type: integer + format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QueryUserRequestBody' + multipart/form-data: + schema: + $ref: '#/components/schemas/QueryUserRequestForm' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/QueryUserRequestForm' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/QueryUserResponseBody' + /v1/user/update/{user_id}: + post: + tags: + - UserService + operationId: UserService_UpdateUser + parameters: + - name: user_id + in: path + required: true + schema: + type: integer + format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateUserRequestBody' + multipart/form-data: + schema: + $ref: '#/components/schemas/UpdateUserRequestForm' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/UpdateUserRequestForm' + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateUserResponseBody' +components: + schemas: + CreateUserRequestBody: + type: object + properties: + name: + title: user name + maxLength: 255 + type: string + gender: + enum: + - Unknown + - Male + - Female + type: string + format: enum + age: + type: integer + format: int64 + introduce: + type: string + CreateUserRequestForm: + type: object + properties: + name: + title: user name + maxLength: 255 + type: string + gender: + enum: + - Unknown + - Male + - Female + type: string + format: enum + age: + type: integer + format: int64 + introduce: + type: string + CreateUserResponseBody: + type: object + properties: + code: + enum: + - Success + - ParamInvalid + - DBErr + type: string + format: enum + msg: + type: string + DeleteUserResponseBody: + type: object + properties: + code: + enum: + - Success + - ParamInvalid + - DBErr + type: string + format: enum + msg: + type: string + QueryUserRequestBody: + title: Query User request + required: + - keyword + - page + - page_size + type: object + properties: + keyword: + type: string + page: + type: integer + format: int64 + page_size: + type: integer + format: int64 + description: Query User request + QueryUserRequestForm: + title: Query User request + required: + - keyword + - page + - page_size + type: object + properties: + keyword: + type: string + page: + type: integer + format: int64 + page_size: + type: integer + format: int64 + description: Query User request + QueryUserResponseBody: + type: object + properties: + code: + enum: + - Success + - ParamInvalid + - DBErr + type: string + format: enum + msg: + type: string + users: + title: user name + maxLength: 255 + type: array + items: + $ref: '#/components/schemas/User' + total: + type: integer + format: int64 + UpdateUserRequestBody: + type: object + properties: + name: + type: string + gender: + enum: + - Unknown + - Male + - Female + type: string + format: enum + age: + type: integer + format: int64 + introduce: + type: string + UpdateUserRequestForm: + type: object + properties: + name: + type: string + gender: + enum: + - Unknown + - Male + - Female + type: string + format: enum + age: + type: integer + format: int64 + introduce: + type: string + UpdateUserResponseBody: + type: object + properties: + code: + enum: + - Success + - ParamInvalid + - DBErr + type: string + format: enum + msg: + type: string + User: + type: object + properties: + user_id: + type: integer + format: int64 + name: + type: string + gender: + enum: + - Unknown + - Male + - Female + type: string + format: enum + age: + type: integer + format: int64 + introduce: + type: string +tags: + - name: UserService + description: user service description diff --git a/bizdemo/hertz_swagger_gen/swagger/swagger.go b/bizdemo/hertz_swagger_gen/swagger/swagger.go new file mode 100644 index 00000000..684943f9 --- /dev/null +++ b/bizdemo/hertz_swagger_gen/swagger/swagger.go @@ -0,0 +1,30 @@ +// Code generated by thrift-gen-http-swagger. +package swagger + +import ( + "context" + _ "embed" + + "github.com/cloudwego/hertz/pkg/app" + "github.com/cloudwego/hertz/pkg/app/server" + "github.com/hertz-contrib/cors" + "github.com/hertz-contrib/swagger" + swaggerFiles "github.com/swaggo/files" +) + +//go:embed openapi.yaml +var openapiYAML []byte + +func BindSwagger(h *server.Hertz) { + h.Use(cors.Default()) + + h.GET("/swagger/*any", swagger.WrapHandler( + swaggerFiles.Handler, + swagger.URL("/openapi.yaml"), + )) + + h.GET("/openapi.yaml", func(c context.Context, ctx *app.RequestContext) { + ctx.Header("Content-Type", "application/x-yaml") + ctx.Write(openapiYAML) + }) +}