//------------------------------------------------------------------------------ // // This code was generated by a tool. // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ package cfg; import "errors" type AiSimpleParallel struct { Id int32 NodeName string Decorators []interface{} Services []interface{} FinishMode int32 MainTask interface{} BackgroundNode interface{} } const TypeId_AiSimpleParallel = -1952582529 func (*AiSimpleParallel) GetTypeId() int32 { return -1952582529 } func NewAiSimpleParallel(_buf map[string]interface{}) (_v *AiSimpleParallel, err error) { _v = &AiSimpleParallel{} { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) } { var _ok_ bool; if _v.NodeName, _ok_ = _buf["node_name"].(string); !_ok_ { err = errors.New("node_name error"); return } } { var _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["decorators"].([]interface{}); !_ok_ { err = errors.New("decorators error"); return } _v.Decorators = make([]interface{}, 0, len(_arr_)) for _, _e_ := range _arr_ { var _list_v_ interface{} { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = NewAiDecorator(_x_); err != nil { return } } _v.Decorators = append(_v.Decorators, _list_v_) } } { var _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["services"].([]interface{}); !_ok_ { err = errors.New("services error"); return } _v.Services = make([]interface{}, 0, len(_arr_)) for _, _e_ := range _arr_ { var _list_v_ interface{} { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = NewAiService(_x_); err != nil { return } } _v.Services = append(_v.Services, _list_v_) } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["finish_mode"].(float64); !_ok_ { err = errors.New("finish_mode error"); return }; _v.FinishMode = int32(_tempNum_) } { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["main_task"].(map[string]interface{}); !_ok_ { err = errors.New("main_task error"); return }; if _v.MainTask, err = NewAiTask(_x_); err != nil { return } } { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["background_node"].(map[string]interface{}); !_ok_ { err = errors.New("background_node error"); return }; if _v.BackgroundNode, err = NewAiFlowNode(_x_); err != nil { return } } return }