Пример #1
0
func (v *ConflictingNamesSetValueArgs) FromWire(w wire.Value) error {
	var err error
	keyIsSet := false
	valueIsSet := false
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TBinary {
				v.Key, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				keyIsSet = true
			}
		case 2:
			if field.Value.Type() == wire.TBinary {
				v.Value, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}
				valueIsSet = true
			}
		}
	}
	if !keyIsSet {
		return errors.New("field Key of ConflictingNamesSetValueArgs is required")
	}
	if !valueIsSet {
		return errors.New("field Value of ConflictingNamesSetValueArgs is required")
	}
	return nil
}
Пример #2
0
func (v *Cache_Clear_Args) FromWire(w wire.Value) error {
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		}
	}
	return nil
}
Пример #3
0
func (v *Event) FromWire(w wire.Value) error {
	var err error
	uuidIsSet := false
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.UUID, err = _UUID_Read(field.Value)
				if err != nil {
					return err
				}
				uuidIsSet = true
			}
		case 2:
			if field.Value.Type() == wire.TI64 {
				var x Timestamp
				x, err = _Timestamp_Read(field.Value)
				v.Time = &x
				if err != nil {
					return err
				}
			}
		}
	}
	if !uuidIsSet {
		return errors.New("field UUID of Event is required")
	}
	return nil
}
Пример #4
0
func (v *KeyValue_GetValue_Result) FromWire(w wire.Value) error {
	var err error
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 0:
			if field.Value.Type() == wire.TStruct {
				v.Success, err = _ArbitraryValue_Read(field.Value)
				if err != nil {
					return err
				}
			}
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.DoesNotExist, err = _DoesNotExistException_Read(field.Value)
				if err != nil {
					return err
				}
			}
		}
	}
	count := 0
	if v.Success != nil {
		count++
	}
	if v.DoesNotExist != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("KeyValue_GetValue_Result should have exactly one field: got %v fields", count)
	}
	return nil
}
Пример #5
0
func (v *KeyValue_SetValue_Result) FromWire(w wire.Value) error {
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		}
	}
	return nil
}
Пример #6
0
func (v *EmptyUnion) FromWire(w wire.Value) error {
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		}
	}
	return nil
}
func (v *NonStandardServiceName_NonStandardFunctionName_Result) FromWire(w wire.Value) error {
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		}
	}
	return nil
}
Пример #8
0
func (v *Point) FromWire(w wire.Value) error {
	var err error
	xIsSet := false
	yIsSet := false
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TDouble {
				v.X, err = field.Value.GetDouble(), error(nil)
				if err != nil {
					return err
				}
				xIsSet = true
			}
		case 2:
			if field.Value.Type() == wire.TDouble {
				v.Y, err = field.Value.GetDouble(), error(nil)
				if err != nil {
					return err
				}
				yIsSet = true
			}
		}
	}
	if !xIsSet {
		return errors.New("field X of Point is required")
	}
	if !yIsSet {
		return errors.New("field Y of Point is required")
	}
	return nil
}
Пример #9
0
func (v *PrimitiveContainers) FromWire(w wire.Value) error {
	var err error
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TList {
				v.A, err = _List_String_Read(field.Value.GetList())
				if err != nil {
					return err
				}
			}
		case 3:
			if field.Value.Type() == wire.TSet {
				v.B, err = _Set_String_Read(field.Value.GetSet())
				if err != nil {
					return err
				}
			}
		case 5:
			if field.Value.Type() == wire.TMap {
				v.C, err = _Map_String_String_Read(field.Value.GetMap())
				if err != nil {
					return err
				}
			}
		}
	}
	return nil
}
Пример #10
0
func (v *Frame) FromWire(w wire.Value) error {
	var err error
	topLeftIsSet := false
	sizeIsSet := false
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.TopLeft, err = _Point_Read(field.Value)
				if err != nil {
					return err
				}
				topLeftIsSet = true
			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.Size, err = _Size_Read(field.Value)
				if err != nil {
					return err
				}
				sizeIsSet = true
			}
		}
	}
	if !topLeftIsSet {
		return errors.New("field TopLeft of Frame is required")
	}
	if !sizeIsSet {
		return errors.New("field Size of Frame is required")
	}
	return nil
}
Пример #11
0
func (v *Node) FromWire(w wire.Value) error {
	var err error
	valueIsSet := false
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TI32 {
				v.Value, err = field.Value.GetI32(), error(nil)
				if err != nil {
					return err
				}
				valueIsSet = true
			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.Tail, err = _List_Read(field.Value)
				if err != nil {
					return err
				}
			}
		}
	}
	if !valueIsSet {
		return errors.New("field Value of Node is required")
	}
	return nil
}
Пример #12
0
func (v *Edge) FromWire(w wire.Value) error {
	var err error
	startPointIsSet := false
	endPointIsSet := false
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.StartPoint, err = _Point_Read(field.Value)
				if err != nil {
					return err
				}
				startPointIsSet = true
			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.EndPoint, err = _Point_Read(field.Value)
				if err != nil {
					return err
				}
				endPointIsSet = true
			}
		}
	}
	if !startPointIsSet {
		return errors.New("field StartPoint of Edge is required")
	}
	if !endPointIsSet {
		return errors.New("field EndPoint of Edge is required")
	}
	return nil
}
Пример #13
0
func (v *User) FromWire(w wire.Value) error {
	var err error
	nameIsSet := false
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TBinary {
				v.Name, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				nameIsSet = true
			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.Contact, err = _ContactInfo_Read(field.Value)
				if err != nil {
					return err
				}
			}
		}
	}
	if !nameIsSet {
		return errors.New("field Name of User is required")
	}
	return nil
}
Пример #14
0
func (v *Size) FromWire(w wire.Value) error {
	var err error
	widthIsSet := false
	heightIsSet := false
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TDouble {
				v.Width, err = field.Value.GetDouble(), error(nil)
				if err != nil {
					return err
				}
				widthIsSet = true
			}
		case 2:
			if field.Value.Type() == wire.TDouble {
				v.Height, err = field.Value.GetDouble(), error(nil)
				if err != nil {
					return err
				}
				heightIsSet = true
			}
		}
	}
	if !widthIsSet {
		return errors.New("field Width of Size is required")
	}
	if !heightIsSet {
		return errors.New("field Height of Size is required")
	}
	return nil
}
Пример #15
0
func (v *KeyValue_SetValue_Args) FromWire(w wire.Value) error {
	var err error
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Key = &x
				if err != nil {
					return err
				}
			}
		case 2:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Value = &x
				if err != nil {
					return err
				}
			}
		}
	}
	return nil
}
Пример #16
0
func (v *StructCollision2) FromWire(w wire.Value) error {
	var err error
	collisionFieldIsSet := false
	collision_fieldIsSet := false
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TBool {
				v.CollisionField, err = field.Value.GetBool(), error(nil)
				if err != nil {
					return err
				}
				collisionFieldIsSet = true
			}
		case 2:
			if field.Value.Type() == wire.TBinary {
				v.CollisionField2, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				collision_fieldIsSet = true
			}
		}
	}
	if !collisionFieldIsSet {
		return errors.New("field CollisionField of StructCollision2 is required")
	}
	if !collision_fieldIsSet {
		return errors.New("field CollisionField2 of StructCollision2 is required")
	}
	return nil
}
Пример #17
0
func (v *Document) FromWire(w wire.Value) error {
	var err error
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TBinary {
				v.Pdf, err = _PDF_Read(field.Value)
				if err != nil {
					return err
				}
			}
		case 2:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.PlainText = &x
				if err != nil {
					return err
				}
			}
		}
	}
	count := 0
	if v.Pdf != nil {
		count++
	}
	if v.PlainText != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("Document should have exactly one field: got %v fields", count)
	}
	return nil
}
Пример #18
0
func (v *ThriftTest_TestVoid_Args) FromWire(w wire.Value) error {
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		}
	}
	return nil
}
Пример #19
0
func (v *KeyValue_DeleteValue_Result) FromWire(w wire.Value) error {
	var err error
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.DoesNotExist, err = _DoesNotExistException_Read(field.Value)
				if err != nil {
					return err
				}
			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.InternalError, err = _InternalError_Read(field.Value)
				if err != nil {
					return err
				}
			}
		}
	}
	count := 0
	if v.DoesNotExist != nil {
		count++
	}
	if v.InternalError != nil {
		count++
	}
	if count > 1 {
		return fmt.Errorf("KeyValue_DeleteValue_Result should have at most one field: got %v fields", count)
	}
	return nil
}
Пример #20
0
func (v *KeyValue_GetValue_Result) FromWire(w wire.Value) error {
	var err error
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 0:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Success = &x
				if err != nil {
					return err
				}
			}
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.DoesNotExist, err = _ResourceDoesNotExist_Read(field.Value)
				if err != nil {
					return err
				}
			}
		}
	}
	count := 0
	if v.Success != nil {
		count++
	}
	if v.DoesNotExist != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("KeyValue_GetValue_Result should have exactly one field: got %v fields", count)
	}
	return nil
}
Пример #21
0
func (v *EnumContainers) FromWire(w wire.Value) error {
	var err error
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TList {
				v.ListOfEnums, err = _List_EnumDefault_Read(field.Value.GetList())
				if err != nil {
					return err
				}
			}
		case 2:
			if field.Value.Type() == wire.TSet {
				v.SetOfEnums, err = _Set_EnumWithValues_Read(field.Value.GetSet())
				if err != nil {
					return err
				}
			}
		case 3:
			if field.Value.Type() == wire.TMap {
				v.MapOfEnums, err = _Map_EnumWithDuplicateValues_I32_Read(field.Value.GetMap())
				if err != nil {
					return err
				}
			}
		}
	}
	return nil
}
Пример #22
0
func (v *DoesNotExistException) FromWire(w wire.Value) error {
	var err error
	keyIsSet := false
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TBinary {
				v.Key, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				keyIsSet = true
			}
		case 2:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Error2 = &x
				if err != nil {
					return err
				}
			}
		}
	}
	if !keyIsSet {
		return errors.New("field Key of DoesNotExistException is required")
	}
	return nil
}
Пример #23
0
func (v *KeyValue_SetValueV2_Args) FromWire(w wire.Value) error {
	var err error
	keyIsSet := false
	valueIsSet := false
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TBinary {
				v.Key, err = _Key_Read(field.Value)
				if err != nil {
					return err
				}
				keyIsSet = true
			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.Value, err = _ArbitraryValue_Read(field.Value)
				if err != nil {
					return err
				}
				valueIsSet = true
			}
		}
	}
	if !keyIsSet {
		return errors.New("field Key of KeyValue_SetValueV2_Args is required")
	}
	if !valueIsSet {
		return errors.New("field Value of KeyValue_SetValueV2_Args is required")
	}
	return nil
}
func (v *ThriftTest_TestMultiException_Args) FromWire(w wire.Value) error {
	var err error
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Arg0 = &x
				if err != nil {
					return err
				}
			}
		case 2:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Arg1 = &x
				if err != nil {
					return err
				}
			}
		}
	}
	return nil
}
Пример #25
0
func (v *TApplicationException) FromWire(w wire.Value) error {
	var err error
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Message = &x
				if err != nil {
					return err
				}
			}
		case 2:
			if field.Value.Type() == wire.TI32 {
				var x ExceptionType
				x, err = _ExceptionType_Read(field.Value)
				v.Type = &x
				if err != nil {
					return err
				}
			}
		}
	}
	return nil
}
Пример #26
0
func (v *SecondService_BlahBlah_Args) FromWire(w wire.Value) error {
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		}
	}
	return nil
}
Пример #27
0
func (v *ThriftTest_TestMulti_Args) FromWire(w wire.Value) error {
	var err error
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TI8 {
				var x int8
				x, err = field.Value.GetI8(), error(nil)
				v.Arg0 = &x
				if err != nil {
					return err
				}
			}
		case 2:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.Arg1 = &x
				if err != nil {
					return err
				}
			}
		case 3:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.Arg2 = &x
				if err != nil {
					return err
				}
			}
		case 4:
			if field.Value.Type() == wire.TMap {
				v.Arg3, err = _Map_I16_String_Read(field.Value.GetMap())
				if err != nil {
					return err
				}
			}
		case 5:
			if field.Value.Type() == wire.TI32 {
				var x Numberz
				x, err = _Numberz_Read(field.Value)
				v.Arg4 = &x
				if err != nil {
					return err
				}
			}
		case 6:
			if field.Value.Type() == wire.TI64 {
				var x UserId
				x, err = _UserId_Read(field.Value)
				v.Arg5 = &x
				if err != nil {
					return err
				}
			}
		}
	}
	return nil
}
Пример #28
0
func (v *Plugin_Goodbye_Args) FromWire(w wire.Value) error {
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		}
	}
	return nil
}
Пример #29
0
func (v *I128) FromWire(w wire.Value) error {
	var err error
	highIsSet := false
	lowIsSet := false
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TI64 {
				v.High, err = field.Value.GetI64(), error(nil)
				if err != nil {
					return err
				}
				highIsSet = true
			}
		case 2:
			if field.Value.Type() == wire.TI64 {
				v.Low, err = field.Value.GetI64(), error(nil)
				if err != nil {
					return err
				}
				lowIsSet = true
			}
		}
	}
	if !highIsSet {
		return errors.New("field High of I128 is required")
	}
	if !lowIsSet {
		return errors.New("field Low of I128 is required")
	}
	return nil
}
Пример #30
0
func (v *HandshakeRequest) FromWire(w wire.Value) error {
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		}
	}
	return nil
}