From 46dd3a97c0e6519fd7a6c5f9037f57a95a1dbbb5 Mon Sep 17 00:00:00 2001 From: Todd Kazakov Date: Wed, 8 Jul 2020 14:35:30 +0300 Subject: [PATCH] Use decimal type to represent device limits and bounds --- api/api.pb.go | 481 ++++++++++++++++++++++++----------------- api/api.proto | 24 +- config/devices.go | 86 +++++++- config/devices_test.go | 88 ++++---- repo/pumps_config.go | 56 ++++- 5 files changed, 473 insertions(+), 262 deletions(-) diff --git a/api/api.pb.go b/api/api.pb.go index 87d8946..55ecfb3 100644 --- a/api/api.pb.go +++ b/api/api.pb.go @@ -707,7 +707,7 @@ type BasalRatesGuardRail struct { // Basal rate units Units BasalRateUnits `protobuf:"varint,1,opt,name=units,proto3,enum=api.BasalRateUnits" json:"units,omitempty"` // Default value - DefaultValue float64 `protobuf:"fixed64,2,opt,name=defaultValue,proto3" json:"defaultValue,omitempty"` + DefaultValue *FixedDecimal `protobuf:"bytes,2,opt,name=defaultValue,proto3" json:"defaultValue,omitempty"` // Device specific absolute bounds. Some pumps might have different increments for different ranges. AbsoluteBounds []*AbsoluteBounds `protobuf:"bytes,3,rep,name=absoluteBounds,proto3" json:"absoluteBounds,omitempty"` } @@ -751,11 +751,11 @@ func (x *BasalRatesGuardRail) GetUnits() BasalRateUnits { return BasalRateUnits_UnitsPerHour } -func (x *BasalRatesGuardRail) GetDefaultValue() float64 { +func (x *BasalRatesGuardRail) GetDefaultValue() *FixedDecimal { if x != nil { return x.DefaultValue } - return 0 + return nil } func (x *BasalRatesGuardRail) GetAbsoluteBounds() []*AbsoluteBounds { @@ -839,7 +839,7 @@ type BasalRateMaximumGuardRail struct { // Basal rate units Units BasalRateUnits `protobuf:"varint,1,opt,name=units,proto3,enum=api.BasalRateUnits" json:"units,omitempty"` // Default value - DefaultValue float64 `protobuf:"fixed64,2,opt,name=defaultValue,proto3" json:"defaultValue,omitempty"` + DefaultValue *FixedDecimal `protobuf:"bytes,2,opt,name=defaultValue,proto3" json:"defaultValue,omitempty"` // Device specific absolute bounds AbsoluteBounds *AbsoluteBounds `protobuf:"bytes,3,opt,name=absoluteBounds,proto3" json:"absoluteBounds,omitempty"` } @@ -883,11 +883,11 @@ func (x *BasalRateMaximumGuardRail) GetUnits() BasalRateUnits { return BasalRateUnits_UnitsPerHour } -func (x *BasalRateMaximumGuardRail) GetDefaultValue() float64 { +func (x *BasalRateMaximumGuardRail) GetDefaultValue() *FixedDecimal { if x != nil { return x.DefaultValue } - return 0 + return nil } func (x *BasalRateMaximumGuardRail) GetAbsoluteBounds() *AbsoluteBounds { @@ -905,7 +905,7 @@ type BolusAmountMaximumGuardRail struct { // Bolus units Units BolusUnits `protobuf:"varint,1,opt,name=units,proto3,enum=api.BolusUnits" json:"units,omitempty"` // Default value - DefaultValue float64 `protobuf:"fixed64,2,opt,name=defaultValue,proto3" json:"defaultValue,omitempty"` + DefaultValue *FixedDecimal `protobuf:"bytes,2,opt,name=defaultValue,proto3" json:"defaultValue,omitempty"` // Tidepool recommended bounds RecommendedBounds *RecommendedBounds `protobuf:"bytes,3,opt,name=recommendedBounds,proto3" json:"recommendedBounds,omitempty"` // Device specific absolute bounds @@ -951,11 +951,11 @@ func (x *BolusAmountMaximumGuardRail) GetUnits() BolusUnits { return BolusUnits_Units } -func (x *BolusAmountMaximumGuardRail) GetDefaultValue() float64 { +func (x *BolusAmountMaximumGuardRail) GetDefaultValue() *FixedDecimal { if x != nil { return x.DefaultValue } - return 0 + return nil } func (x *BolusAmountMaximumGuardRail) GetRecommendedBounds() *RecommendedBounds { @@ -1045,11 +1045,11 @@ type AbsoluteBounds struct { unknownFields protoimpl.UnknownFields // Lower bound (inclusive) - Minimum float64 `protobuf:"fixed64,1,opt,name=minimum,proto3" json:"minimum,omitempty"` + Minimum *FixedDecimal `protobuf:"bytes,1,opt,name=minimum,proto3" json:"minimum,omitempty"` // Upper bound (inclusive) - Maximum float64 `protobuf:"fixed64,2,opt,name=maximum,proto3" json:"maximum,omitempty"` + Maximum *FixedDecimal `protobuf:"bytes,2,opt,name=maximum,proto3" json:"maximum,omitempty"` // Increment - Increment float64 `protobuf:"fixed64,3,opt,name=increment,proto3" json:"increment,omitempty"` + Increment *FixedDecimal `protobuf:"bytes,3,opt,name=increment,proto3" json:"increment,omitempty"` } func (x *AbsoluteBounds) Reset() { @@ -1084,25 +1084,25 @@ func (*AbsoluteBounds) Descriptor() ([]byte, []int) { return file_api_proto_rawDescGZIP(), []int{13} } -func (x *AbsoluteBounds) GetMinimum() float64 { +func (x *AbsoluteBounds) GetMinimum() *FixedDecimal { if x != nil { return x.Minimum } - return 0 + return nil } -func (x *AbsoluteBounds) GetMaximum() float64 { +func (x *AbsoluteBounds) GetMaximum() *FixedDecimal { if x != nil { return x.Maximum } - return 0 + return nil } -func (x *AbsoluteBounds) GetIncrement() float64 { +func (x *AbsoluteBounds) GetIncrement() *FixedDecimal { if x != nil { return x.Increment } - return 0 + return nil } // Closed range double interval @@ -1112,9 +1112,9 @@ type RecommendedBounds struct { unknownFields protoimpl.UnknownFields // Lower bound (inclusive) - Minimum float64 `protobuf:"fixed64,1,opt,name=minimum,proto3" json:"minimum,omitempty"` + Minimum *FixedDecimal `protobuf:"bytes,1,opt,name=minimum,proto3" json:"minimum,omitempty"` // Upper bound (inclusive) - Maximum float64 `protobuf:"fixed64,2,opt,name=maximum,proto3" json:"maximum,omitempty"` + Maximum *FixedDecimal `protobuf:"bytes,2,opt,name=maximum,proto3" json:"maximum,omitempty"` } func (x *RecommendedBounds) Reset() { @@ -1149,17 +1149,74 @@ func (*RecommendedBounds) Descriptor() ([]byte, []int) { return file_api_proto_rawDescGZIP(), []int{14} } -func (x *RecommendedBounds) GetMinimum() float64 { +func (x *RecommendedBounds) GetMinimum() *FixedDecimal { if x != nil { return x.Minimum } - return 0 + return nil } -func (x *RecommendedBounds) GetMaximum() float64 { +func (x *RecommendedBounds) GetMaximum() *FixedDecimal { if x != nil { return x.Maximum } + return nil +} + +type FixedDecimal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The whole units of the amount + Units int64 `protobuf:"varint,1,opt,name=units,proto3" json:"units,omitempty"` + // Number of nano (10^-9) units of the amount. + Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` +} + +func (x *FixedDecimal) Reset() { + *x = FixedDecimal{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FixedDecimal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FixedDecimal) ProtoMessage() {} + +func (x *FixedDecimal) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FixedDecimal.ProtoReflect.Descriptor instead. +func (*FixedDecimal) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{15} +} + +func (x *FixedDecimal) GetUnits() int64 { + if x != nil { + return x.Units + } + return 0 +} + +func (x *FixedDecimal) GetNanos() int32 { + if x != nil { + return x.Nanos + } return 0 } @@ -1174,7 +1231,7 @@ type GetCgmByIdRequest struct { func (x *GetCgmByIdRequest) Reset() { *x = GetCgmByIdRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[15] + mi := &file_api_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1187,7 +1244,7 @@ func (x *GetCgmByIdRequest) String() string { func (*GetCgmByIdRequest) ProtoMessage() {} func (x *GetCgmByIdRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[15] + mi := &file_api_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1200,7 +1257,7 @@ func (x *GetCgmByIdRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCgmByIdRequest.ProtoReflect.Descriptor instead. func (*GetCgmByIdRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{15} + return file_api_proto_rawDescGZIP(), []int{16} } func (x *GetCgmByIdRequest) GetId() string { @@ -1221,7 +1278,7 @@ type GetCgmByIdResponse struct { func (x *GetCgmByIdResponse) Reset() { *x = GetCgmByIdResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[16] + mi := &file_api_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1234,7 +1291,7 @@ func (x *GetCgmByIdResponse) String() string { func (*GetCgmByIdResponse) ProtoMessage() {} func (x *GetCgmByIdResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[16] + mi := &file_api_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1247,7 +1304,7 @@ func (x *GetCgmByIdResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCgmByIdResponse.ProtoReflect.Descriptor instead. func (*GetCgmByIdResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{16} + return file_api_proto_rawDescGZIP(), []int{17} } func (x *GetCgmByIdResponse) GetCgm() *Cgm { @@ -1266,7 +1323,7 @@ type ListCgmsRequest struct { func (x *ListCgmsRequest) Reset() { *x = ListCgmsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[17] + mi := &file_api_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1279,7 +1336,7 @@ func (x *ListCgmsRequest) String() string { func (*ListCgmsRequest) ProtoMessage() {} func (x *ListCgmsRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[17] + mi := &file_api_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1292,7 +1349,7 @@ func (x *ListCgmsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListCgmsRequest.ProtoReflect.Descriptor instead. func (*ListCgmsRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{17} + return file_api_proto_rawDescGZIP(), []int{18} } type ListCgmsResponse struct { @@ -1306,7 +1363,7 @@ type ListCgmsResponse struct { func (x *ListCgmsResponse) Reset() { *x = ListCgmsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[18] + mi := &file_api_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1319,7 +1376,7 @@ func (x *ListCgmsResponse) String() string { func (*ListCgmsResponse) ProtoMessage() {} func (x *ListCgmsResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[18] + mi := &file_api_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1332,7 +1389,7 @@ func (x *ListCgmsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListCgmsResponse.ProtoReflect.Descriptor instead. func (*ListCgmsResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{18} + return file_api_proto_rawDescGZIP(), []int{19} } func (x *ListCgmsResponse) GetCgms() []*Cgm { @@ -1360,7 +1417,7 @@ type Cgm struct { func (x *Cgm) Reset() { *x = Cgm{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[19] + mi := &file_api_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1373,7 +1430,7 @@ func (x *Cgm) String() string { func (*Cgm) ProtoMessage() {} func (x *Cgm) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[19] + mi := &file_api_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1386,7 +1443,7 @@ func (x *Cgm) ProtoReflect() protoreflect.Message { // Deprecated: Use Cgm.ProtoReflect.Descriptor instead. func (*Cgm) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{19} + return file_api_proto_rawDescGZIP(), []int{20} } func (x *Cgm) GetId() string { @@ -1503,133 +1560,146 @@ var file_api_proto_rawDesc = []byte{ 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, - 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x13, 0x42, 0x61, + 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x22, 0xb4, 0x01, 0x0a, 0x13, 0x42, 0x61, 0x73, 0x61, 0x6c, 0x52, 0x61, 0x74, 0x65, 0x73, 0x47, 0x75, 0x61, 0x72, 0x64, 0x52, 0x61, 0x69, 0x6c, 0x12, 0x29, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x61, 0x73, 0x61, 0x6c, 0x52, 0x61, 0x74, 0x65, - 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x0c, + 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x35, 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x3b, 0x0a, 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, - 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, - 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x0e, 0x61, - 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x22, 0xd2, 0x01, - 0x0a, 0x1a, 0x43, 0x61, 0x72, 0x62, 0x6f, 0x68, 0x79, 0x64, 0x72, 0x61, 0x74, 0x65, 0x52, 0x61, - 0x74, 0x69, 0x6f, 0x47, 0x75, 0x61, 0x72, 0x64, 0x52, 0x61, 0x69, 0x6c, 0x12, 0x31, 0x0a, 0x05, - 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x43, 0x61, 0x72, 0x62, 0x6f, 0x68, 0x79, 0x64, 0x72, 0x61, 0x74, 0x65, 0x52, 0x61, - 0x74, 0x69, 0x6f, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x12, - 0x44, 0x0a, 0x11, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6f, - 0x75, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x75, 0x6e, - 0x64, 0x73, 0x52, 0x11, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x42, - 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x3b, 0x0a, 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x44, 0x65, + 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, + 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x41, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, + 0x52, 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, + 0x22, 0xd2, 0x01, 0x0a, 0x1a, 0x43, 0x61, 0x72, 0x62, 0x6f, 0x68, 0x79, 0x64, 0x72, 0x61, 0x74, + 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x47, 0x75, 0x61, 0x72, 0x64, 0x52, 0x61, 0x69, 0x6c, 0x12, + 0x31, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x61, 0x72, 0x62, 0x6f, 0x68, 0x79, 0x64, 0x72, 0x61, 0x74, + 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x05, 0x75, 0x6e, 0x69, + 0x74, 0x73, 0x12, 0x44, 0x0a, 0x11, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, + 0x64, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x42, + 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x11, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, + 0x65, 0x64, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x3b, 0x0a, 0x0e, 0x61, 0x62, 0x73, 0x6f, + 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, + 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, + 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x22, 0xba, 0x01, 0x0a, 0x19, 0x42, 0x61, 0x73, 0x61, 0x6c, 0x52, + 0x61, 0x74, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x47, 0x75, 0x61, 0x72, 0x64, 0x52, + 0x61, 0x69, 0x6c, 0x12, 0x29, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x61, 0x73, 0x61, 0x6c, 0x52, 0x61, + 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x35, + 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, + 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, - 0x64, 0x73, 0x22, 0xa7, 0x01, 0x0a, 0x19, 0x42, 0x61, 0x73, 0x61, 0x6c, 0x52, 0x61, 0x74, 0x65, - 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x47, 0x75, 0x61, 0x72, 0x64, 0x52, 0x61, 0x69, 0x6c, - 0x12, 0x29, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x61, 0x73, 0x61, 0x6c, 0x52, 0x61, 0x74, 0x65, 0x55, - 0x6e, 0x69, 0x74, 0x73, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x01, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x3b, 0x0a, 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x62, - 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x0e, 0x61, 0x62, - 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x22, 0xeb, 0x01, 0x0a, - 0x1b, 0x42, 0x6f, 0x6c, 0x75, 0x73, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x61, 0x78, 0x69, - 0x6d, 0x75, 0x6d, 0x47, 0x75, 0x61, 0x72, 0x64, 0x52, 0x61, 0x69, 0x6c, 0x12, 0x25, 0x0a, 0x05, - 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x42, 0x6f, 0x6c, 0x75, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x05, 0x75, 0x6e, - 0x69, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x44, 0x0a, 0x11, 0x72, 0x65, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x11, 0x72, 0x65, 0x63, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x3b, 0x0a, - 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x62, 0x73, 0x6f, - 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x0e, 0x61, 0x62, 0x73, 0x6f, - 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x22, 0xcb, 0x01, 0x0a, 0x18, 0x43, - 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x47, 0x75, - 0x61, 0x72, 0x64, 0x52, 0x61, 0x69, 0x6c, 0x12, 0x2c, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x6c, 0x6f, - 0x6f, 0x64, 0x47, 0x6c, 0x75, 0x63, 0x6f, 0x73, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x05, - 0x75, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x44, 0x0a, 0x11, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, - 0x65, 0x64, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x11, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, - 0x65, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x3b, 0x0a, 0x0e, 0x61, - 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x62, 0x73, 0x6f, 0x6c, 0x75, - 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, - 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x22, 0x62, 0x0a, 0x0e, 0x41, 0x62, 0x73, 0x6f, - 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, - 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, - 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1c, - 0x0a, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x01, 0x52, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x47, 0x0a, 0x11, + 0x64, 0x73, 0x22, 0xfe, 0x01, 0x0a, 0x1b, 0x42, 0x6f, 0x6c, 0x75, 0x73, 0x41, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x47, 0x75, 0x61, 0x72, 0x64, 0x52, 0x61, + 0x69, 0x6c, 0x12, 0x25, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x6f, 0x6c, 0x75, 0x73, 0x55, 0x6e, 0x69, + 0x74, 0x73, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x35, 0x0a, 0x0c, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x44, 0x65, 0x63, 0x69, 0x6d, + 0x61, 0x6c, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x44, 0x0a, 0x11, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x42, + 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x75, + 0x6e, 0x64, 0x73, 0x52, 0x11, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, + 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x3b, 0x0a, 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, + 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, + 0x6e, 0x64, 0x73, 0x52, 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, + 0x6e, 0x64, 0x73, 0x22, 0xcb, 0x01, 0x0a, 0x18, 0x43, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x47, 0x75, 0x61, 0x72, 0x64, 0x52, 0x61, 0x69, 0x6c, + 0x12, 0x2c, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x47, 0x6c, 0x75, 0x63, 0x6f, + 0x73, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x44, + 0x0a, 0x11, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x75, + 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x75, 0x6e, 0x64, - 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, - 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x22, 0x23, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x67, 0x6d, 0x42, - 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x30, 0x0a, 0x12, 0x47, 0x65, - 0x74, 0x43, 0x67, 0x6d, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1a, 0x0a, 0x03, 0x63, 0x67, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x43, 0x67, 0x6d, 0x52, 0x03, 0x63, 0x67, 0x6d, 0x22, 0x11, 0x0a, 0x0f, - 0x4c, 0x69, 0x73, 0x74, 0x43, 0x67, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x30, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x67, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x04, 0x63, 0x67, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x08, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x67, 0x6d, 0x52, 0x04, 0x63, 0x67, 0x6d, - 0x73, 0x22, 0x73, 0x0a, 0x03, 0x43, 0x67, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x70, - 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, - 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x61, - 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x73, - 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2a, 0x2f, 0x0a, 0x11, 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x47, - 0x6c, 0x75, 0x63, 0x6f, 0x73, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x16, 0x4d, - 0x69, 0x6c, 0x6c, 0x69, 0x67, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x65, 0x72, 0x44, 0x65, 0x63, 0x69, - 0x6c, 0x69, 0x74, 0x65, 0x72, 0x10, 0x00, 0x2a, 0x22, 0x0a, 0x0e, 0x42, 0x61, 0x73, 0x61, 0x6c, - 0x52, 0x61, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x10, 0x0a, 0x0c, 0x55, 0x6e, 0x69, - 0x74, 0x73, 0x50, 0x65, 0x72, 0x48, 0x6f, 0x75, 0x72, 0x10, 0x00, 0x2a, 0x2a, 0x0a, 0x16, 0x43, - 0x61, 0x72, 0x62, 0x6f, 0x68, 0x79, 0x64, 0x72, 0x61, 0x74, 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, - 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x10, 0x0a, 0x0c, 0x47, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x65, - 0x72, 0x55, 0x6e, 0x69, 0x74, 0x10, 0x00, 0x2a, 0x17, 0x0a, 0x0a, 0x42, 0x6f, 0x6c, 0x75, 0x73, - 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x10, 0x00, - 0x32, 0xf3, 0x02, 0x0a, 0x07, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x60, 0x0a, 0x0b, - 0x47, 0x65, 0x74, 0x50, 0x75, 0x6d, 0x70, 0x42, 0x79, 0x49, 0x64, 0x12, 0x17, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x75, 0x6d, 0x70, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x75, - 0x6d, 0x70, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2f, 0x70, 0x75, 0x6d, 0x70, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x55, - 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x6d, 0x70, 0x73, 0x12, 0x15, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x6d, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x6d, - 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x70, 0x75, 0x6d, 0x70, 0x73, 0x12, 0x5c, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x67, 0x6d, 0x42, - 0x79, 0x49, 0x64, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x67, 0x6d, - 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x67, 0x6d, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x76, - 0x31, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x63, 0x67, 0x6d, 0x73, 0x2f, 0x7b, - 0x69, 0x64, 0x7d, 0x12, 0x51, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x67, 0x6d, 0x73, 0x12, - 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x67, 0x6d, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x43, 0x67, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2f, 0x63, 0x67, 0x6d, 0x73, 0x42, 0x25, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x69, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x2d, 0x6f, 0x72, - 0x67, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x52, 0x11, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6f, + 0x75, 0x6e, 0x64, 0x73, 0x12, 0x3b, 0x0a, 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, + 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x41, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, + 0x73, 0x52, 0x0e, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, 0x75, 0x6e, 0x64, + 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x0e, 0x41, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x42, 0x6f, + 0x75, 0x6e, 0x64, 0x73, 0x12, 0x2b, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x78, 0x65, + 0x64, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, + 0x6d, 0x12, 0x2b, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x44, 0x65, + 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2f, + 0x0a, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x44, 0x65, 0x63, + 0x69, 0x6d, 0x61, 0x6c, 0x52, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, + 0x6d, 0x0a, 0x11, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6f, + 0x75, 0x6e, 0x64, 0x73, 0x12, 0x2b, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x78, 0x65, + 0x64, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, + 0x6d, 0x12, 0x2b, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x44, 0x65, + 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x22, 0x3a, + 0x0a, 0x0c, 0x46, 0x69, 0x78, 0x65, 0x64, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x12, 0x14, + 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x75, + 0x6e, 0x69, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x22, 0x23, 0x0a, 0x11, 0x47, 0x65, + 0x74, 0x43, 0x67, 0x6d, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, + 0x30, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x43, 0x67, 0x6d, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x03, 0x63, 0x67, 0x6d, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x67, 0x6d, 0x52, 0x03, 0x63, 0x67, + 0x6d, 0x22, 0x11, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x67, 0x6d, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0x30, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x67, 0x6d, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x04, 0x63, 0x67, 0x6d, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x67, 0x6d, + 0x52, 0x04, 0x63, 0x67, 0x6d, 0x73, 0x22, 0x73, 0x0a, 0x03, 0x43, 0x67, 0x6d, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x24, 0x0a, 0x0d, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, + 0x75, 0x72, 0x65, 0x72, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2a, 0x2f, 0x0a, 0x11, 0x42, + 0x6c, 0x6f, 0x6f, 0x64, 0x47, 0x6c, 0x75, 0x63, 0x6f, 0x73, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, + 0x12, 0x1a, 0x0a, 0x16, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x67, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x65, + 0x72, 0x44, 0x65, 0x63, 0x69, 0x6c, 0x69, 0x74, 0x65, 0x72, 0x10, 0x00, 0x2a, 0x22, 0x0a, 0x0e, + 0x42, 0x61, 0x73, 0x61, 0x6c, 0x52, 0x61, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x10, + 0x0a, 0x0c, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x50, 0x65, 0x72, 0x48, 0x6f, 0x75, 0x72, 0x10, 0x00, + 0x2a, 0x2a, 0x0a, 0x16, 0x43, 0x61, 0x72, 0x62, 0x6f, 0x68, 0x79, 0x64, 0x72, 0x61, 0x74, 0x65, + 0x52, 0x61, 0x74, 0x69, 0x6f, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x10, 0x0a, 0x0c, 0x47, 0x72, + 0x61, 0x6d, 0x73, 0x50, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, 0x10, 0x00, 0x2a, 0x17, 0x0a, 0x0a, + 0x42, 0x6f, 0x6c, 0x75, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x6e, + 0x69, 0x74, 0x73, 0x10, 0x00, 0x32, 0xf3, 0x02, 0x0a, 0x07, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x12, 0x60, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x50, 0x75, 0x6d, 0x70, 0x42, 0x79, 0x49, 0x64, + 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x75, 0x6d, 0x70, 0x42, 0x79, + 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x75, 0x6d, 0x70, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x76, 0x31, + 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x70, 0x75, 0x6d, 0x70, 0x73, 0x2f, 0x7b, + 0x69, 0x64, 0x7d, 0x12, 0x55, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x6d, 0x70, 0x73, + 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x6d, 0x70, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x50, 0x75, 0x6d, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x2f, 0x70, 0x75, 0x6d, 0x70, 0x73, 0x12, 0x5c, 0x0a, 0x0a, 0x47, 0x65, + 0x74, 0x43, 0x67, 0x6d, 0x42, 0x79, 0x49, 0x64, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, + 0x65, 0x74, 0x43, 0x67, 0x6d, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x67, 0x6d, 0x42, 0x79, 0x49, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x17, 0x12, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x63, + 0x67, 0x6d, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x51, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x67, 0x6d, 0x73, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x67, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x67, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x63, 0x67, 0x6d, 0x73, 0x42, 0x25, 0x5a, 0x23, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x69, 0x64, 0x65, 0x70, 0x6f, + 0x6f, 0x6c, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x61, + 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1645,7 +1715,7 @@ func file_api_proto_rawDescGZIP() []byte { } var file_api_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_api_proto_goTypes = []interface{}{ (BloodGlucoseUnits)(0), // 0: api.BloodGlucoseUnits (BasalRateUnits)(0), // 1: api.BasalRateUnits @@ -1666,11 +1736,12 @@ var file_api_proto_goTypes = []interface{}{ (*CorrectionRangeGuardRail)(nil), // 16: api.CorrectionRangeGuardRail (*AbsoluteBounds)(nil), // 17: api.AbsoluteBounds (*RecommendedBounds)(nil), // 18: api.RecommendedBounds - (*GetCgmByIdRequest)(nil), // 19: api.GetCgmByIdRequest - (*GetCgmByIdResponse)(nil), // 20: api.GetCgmByIdResponse - (*ListCgmsRequest)(nil), // 21: api.ListCgmsRequest - (*ListCgmsResponse)(nil), // 22: api.ListCgmsResponse - (*Cgm)(nil), // 23: api.Cgm + (*FixedDecimal)(nil), // 19: api.FixedDecimal + (*GetCgmByIdRequest)(nil), // 20: api.GetCgmByIdRequest + (*GetCgmByIdResponse)(nil), // 21: api.GetCgmByIdResponse + (*ListCgmsRequest)(nil), // 22: api.ListCgmsRequest + (*ListCgmsResponse)(nil), // 23: api.ListCgmsResponse + (*Cgm)(nil), // 24: api.Cgm } var file_api_proto_depIdxs = []int32{ 8, // 0: api.GetPumpByIdResponse.pump:type_name -> api.Pump @@ -1690,33 +1761,41 @@ var file_api_proto_depIdxs = []int32{ 18, // 14: api.InsulinSensitivityGuardRail.recommendedBounds:type_name -> api.RecommendedBounds 17, // 15: api.InsulinSensitivityGuardRail.absoluteBounds:type_name -> api.AbsoluteBounds 1, // 16: api.BasalRatesGuardRail.units:type_name -> api.BasalRateUnits - 17, // 17: api.BasalRatesGuardRail.absoluteBounds:type_name -> api.AbsoluteBounds - 2, // 18: api.CarbohydrateRatioGuardRail.units:type_name -> api.CarbohydrateRatioUnits - 18, // 19: api.CarbohydrateRatioGuardRail.recommendedBounds:type_name -> api.RecommendedBounds - 17, // 20: api.CarbohydrateRatioGuardRail.absoluteBounds:type_name -> api.AbsoluteBounds - 1, // 21: api.BasalRateMaximumGuardRail.units:type_name -> api.BasalRateUnits - 17, // 22: api.BasalRateMaximumGuardRail.absoluteBounds:type_name -> api.AbsoluteBounds - 3, // 23: api.BolusAmountMaximumGuardRail.units:type_name -> api.BolusUnits - 18, // 24: api.BolusAmountMaximumGuardRail.recommendedBounds:type_name -> api.RecommendedBounds - 17, // 25: api.BolusAmountMaximumGuardRail.absoluteBounds:type_name -> api.AbsoluteBounds - 0, // 26: api.CorrectionRangeGuardRail.units:type_name -> api.BloodGlucoseUnits - 18, // 27: api.CorrectionRangeGuardRail.recommendedBounds:type_name -> api.RecommendedBounds - 17, // 28: api.CorrectionRangeGuardRail.absoluteBounds:type_name -> api.AbsoluteBounds - 23, // 29: api.GetCgmByIdResponse.cgm:type_name -> api.Cgm - 23, // 30: api.ListCgmsResponse.cgms:type_name -> api.Cgm - 4, // 31: api.Devices.GetPumpById:input_type -> api.GetPumpByIdRequest - 6, // 32: api.Devices.ListPumps:input_type -> api.ListPumpsRequest - 19, // 33: api.Devices.GetCgmById:input_type -> api.GetCgmByIdRequest - 21, // 34: api.Devices.ListCgms:input_type -> api.ListCgmsRequest - 5, // 35: api.Devices.GetPumpById:output_type -> api.GetPumpByIdResponse - 7, // 36: api.Devices.ListPumps:output_type -> api.ListPumpsResponse - 20, // 37: api.Devices.GetCgmById:output_type -> api.GetCgmByIdResponse - 22, // 38: api.Devices.ListCgms:output_type -> api.ListCgmsResponse - 35, // [35:39] is the sub-list for method output_type - 31, // [31:35] is the sub-list for method input_type - 31, // [31:31] is the sub-list for extension type_name - 31, // [31:31] is the sub-list for extension extendee - 0, // [0:31] is the sub-list for field type_name + 19, // 17: api.BasalRatesGuardRail.defaultValue:type_name -> api.FixedDecimal + 17, // 18: api.BasalRatesGuardRail.absoluteBounds:type_name -> api.AbsoluteBounds + 2, // 19: api.CarbohydrateRatioGuardRail.units:type_name -> api.CarbohydrateRatioUnits + 18, // 20: api.CarbohydrateRatioGuardRail.recommendedBounds:type_name -> api.RecommendedBounds + 17, // 21: api.CarbohydrateRatioGuardRail.absoluteBounds:type_name -> api.AbsoluteBounds + 1, // 22: api.BasalRateMaximumGuardRail.units:type_name -> api.BasalRateUnits + 19, // 23: api.BasalRateMaximumGuardRail.defaultValue:type_name -> api.FixedDecimal + 17, // 24: api.BasalRateMaximumGuardRail.absoluteBounds:type_name -> api.AbsoluteBounds + 3, // 25: api.BolusAmountMaximumGuardRail.units:type_name -> api.BolusUnits + 19, // 26: api.BolusAmountMaximumGuardRail.defaultValue:type_name -> api.FixedDecimal + 18, // 27: api.BolusAmountMaximumGuardRail.recommendedBounds:type_name -> api.RecommendedBounds + 17, // 28: api.BolusAmountMaximumGuardRail.absoluteBounds:type_name -> api.AbsoluteBounds + 0, // 29: api.CorrectionRangeGuardRail.units:type_name -> api.BloodGlucoseUnits + 18, // 30: api.CorrectionRangeGuardRail.recommendedBounds:type_name -> api.RecommendedBounds + 17, // 31: api.CorrectionRangeGuardRail.absoluteBounds:type_name -> api.AbsoluteBounds + 19, // 32: api.AbsoluteBounds.minimum:type_name -> api.FixedDecimal + 19, // 33: api.AbsoluteBounds.maximum:type_name -> api.FixedDecimal + 19, // 34: api.AbsoluteBounds.increment:type_name -> api.FixedDecimal + 19, // 35: api.RecommendedBounds.minimum:type_name -> api.FixedDecimal + 19, // 36: api.RecommendedBounds.maximum:type_name -> api.FixedDecimal + 24, // 37: api.GetCgmByIdResponse.cgm:type_name -> api.Cgm + 24, // 38: api.ListCgmsResponse.cgms:type_name -> api.Cgm + 4, // 39: api.Devices.GetPumpById:input_type -> api.GetPumpByIdRequest + 6, // 40: api.Devices.ListPumps:input_type -> api.ListPumpsRequest + 20, // 41: api.Devices.GetCgmById:input_type -> api.GetCgmByIdRequest + 22, // 42: api.Devices.ListCgms:input_type -> api.ListCgmsRequest + 5, // 43: api.Devices.GetPumpById:output_type -> api.GetPumpByIdResponse + 7, // 44: api.Devices.ListPumps:output_type -> api.ListPumpsResponse + 21, // 45: api.Devices.GetCgmById:output_type -> api.GetCgmByIdResponse + 23, // 46: api.Devices.ListCgms:output_type -> api.ListCgmsResponse + 43, // [43:47] is the sub-list for method output_type + 39, // [39:43] is the sub-list for method input_type + 39, // [39:39] is the sub-list for extension type_name + 39, // [39:39] is the sub-list for extension extendee + 0, // [0:39] is the sub-list for field type_name } func init() { file_api_proto_init() } @@ -1906,7 +1985,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCgmByIdRequest); i { + switch v := v.(*FixedDecimal); i { case 0: return &v.state case 1: @@ -1918,7 +1997,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCgmByIdResponse); i { + switch v := v.(*GetCgmByIdRequest); i { case 0: return &v.state case 1: @@ -1930,7 +2009,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCgmsRequest); i { + switch v := v.(*GetCgmByIdResponse); i { case 0: return &v.state case 1: @@ -1942,7 +2021,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCgmsResponse); i { + switch v := v.(*ListCgmsRequest); i { case 0: return &v.state case 1: @@ -1954,6 +2033,18 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCgmsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Cgm); i { case 0: return &v.state @@ -1972,7 +2063,7 @@ func file_api_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_proto_rawDesc, NumEnums: 4, - NumMessages: 20, + NumMessages: 21, NumExtensions: 0, NumServices: 1, }, diff --git a/api/api.proto b/api/api.proto index f878e02..6ba38f6 100644 --- a/api/api.proto +++ b/api/api.proto @@ -118,7 +118,7 @@ message BasalRatesGuardRail { BasalRateUnits units = 1; // Default value - double defaultValue = 2; + FixedDecimal defaultValue = 2; // Device specific absolute bounds. Some pumps might have different increments for different ranges. repeated AbsoluteBounds absoluteBounds = 3; @@ -140,7 +140,7 @@ message BasalRateMaximumGuardRail { BasalRateUnits units = 1; // Default value - double defaultValue = 2; + FixedDecimal defaultValue = 2; // Device specific absolute bounds AbsoluteBounds absoluteBounds = 3; @@ -151,7 +151,7 @@ message BolusAmountMaximumGuardRail { BolusUnits units = 1; // Default value - double defaultValue = 2; + FixedDecimal defaultValue = 2; // Tidepool recommended bounds RecommendedBounds recommendedBounds = 3; @@ -174,22 +174,30 @@ message CorrectionRangeGuardRail { // Closed range double interval message AbsoluteBounds { // Lower bound (inclusive) - double minimum = 1; + FixedDecimal minimum = 1; // Upper bound (inclusive) - double maximum = 2; + FixedDecimal maximum = 2; // Increment - double increment = 3; + FixedDecimal increment = 3; } // Closed range double interval message RecommendedBounds { // Lower bound (inclusive) - double minimum = 1; + FixedDecimal minimum = 1; // Upper bound (inclusive) - double maximum = 2; + FixedDecimal maximum = 2; +} + +message FixedDecimal { + // The whole units of the amount + int64 units = 1; + + // Number of nano (10^-9) units of the amount. + int32 nanos = 2; } enum BloodGlucoseUnits { diff --git a/config/devices.go b/config/devices.go index 4bd7918..3053267 100644 --- a/config/devices.go +++ b/config/devices.go @@ -1,7 +1,11 @@ package config import ( + "errors" + "fmt" "io/ioutil" + "strconv" + "strings" "github.com/go-playground/validator/v10" "gopkg.in/yaml.v3" @@ -44,7 +48,7 @@ type GuardRails struct { type GuardRail struct { Units string `yaml:"units" validate:"required"` - DefaultValue *float64 `yaml:"default"` + DefaultValue *FixedDecimal `yaml:"default"` AbsoluteBounds []*AbsoluteBounds `yaml:"absolute_bounds" validate:"required"` RecommendedBounds *RecommendedBounds `yaml:"recommended_bounds"` } @@ -52,7 +56,7 @@ type GuardRail struct { type AbsoluteBounds struct { Bounds `yaml:",inline"` - Increment float64 `yaml:"increment" validate:"gt=0"` + Increment *FixedDecimal `yaml:"increment" validate:"gt=0"` } type RecommendedBounds struct { @@ -60,8 +64,82 @@ type RecommendedBounds struct { } type Bounds struct { - Minimum *float64 `yaml:"min"` - Maximum *float64 `yaml:"max"` + Minimum *FixedDecimal `yaml:"min"` + Maximum *FixedDecimal `yaml:"max"` +} + +type FixedDecimal struct { + Units int64 `yaml:"units"` + Nanos int32 `yaml:"units"` +} + +func (f *FixedDecimal) UnmarshalYAML(unmarshal func(interface{}) error) error { + var value string + if err := unmarshal(&value); err != nil { + return err + } + + if err := ParseFixedDecimal(value, f); err != nil { + return err + } + + return nil +} + +func ParseFixedDecimal(value string, decimal *FixedDecimal) error { + split := strings.Split(value, ".") + if len(split) != 1 && len(split) != 2 { + return errors.New(fmt.Sprintf("invalid fixed decimal value %v", value)) + } + + var units int64 + var nanos int32 + units, err := parseFixedDecimalUnits(split[0]) + if err != nil { + return err + } + if len(split) > 1 { + nanos, err = parseFixedDecimalNanos(split[1]) + if err != nil { + return err + } + } + + decimal.Units = units + decimal.Nanos = nanos + + if units < 0 { + decimal.Nanos = decimal.Nanos * -1 + } + + return nil +} + +func parseFixedDecimalUnits(value string) (int64, error) { + if len(value) == 0 { + return 0, nil + } + val, err := strconv.ParseInt(value, 10, 64) + if err != nil { + return 0, err + } + return val, nil +} + +func parseFixedDecimalNanos(value string) (int32, error) { + if len(value) == 0 { + return 0, nil + } + if len(value) > 9 { + return 0, errors.New("nanos must be 9 digits or less") + } + // pad with trailing zeroes + value = value + strings.Repeat("0", 9-len(value)) + val, err := strconv.ParseInt(value, 10, 32) + if err != nil { + return 0, err + } + return int32(val), nil } func NewDevicesConfig() *DevicesConfig { diff --git a/config/devices_test.go b/config/devices_test.go index acd4d35..6e38fcf 100644 --- a/config/devices_test.go +++ b/config/devices_test.go @@ -66,33 +66,35 @@ func TestDevicesConfig_LoadFromFile(t *testing.T) { }) t.Run("Guard Rails", func(t *testing.T) { - pointerFromFloat := func(i float64) *float64 { return &i } + fixedDecimalsAreEqual := func(a, b FixedDecimal) bool { + return a.Units == b.Units && a.Nanos == b.Nanos + } isExpected := func(t *testing.T, result GuardRail, expected GuardRail) { if result.Units != expected.Units { t.Errorf("expected %v units got %v", expected.Units, result.Units) } if expected.DefaultValue != nil { - if result.DefaultValue == nil || *result.DefaultValue != *expected.DefaultValue { + if result.DefaultValue == nil || !fixedDecimalsAreEqual(*result.DefaultValue,*expected.DefaultValue) { t.Errorf("expected %v got %v", *expected.DefaultValue, *result.DefaultValue) } } if expected.AbsoluteBounds != nil { for i, b := range expected.AbsoluteBounds { - expectedValue := expected.AbsoluteBounds[i].Increment - resultValue := b.Increment - if expectedValue != resultValue { + expectedValue := *expected.AbsoluteBounds[i].Increment + resultValue := *b.Increment + if !fixedDecimalsAreEqual(expectedValue, resultValue) { t.Errorf("expected %v got %v", expectedValue, resultValue) } expectedValue = *expected.AbsoluteBounds[i].Minimum resultValue = *b.Minimum - if expectedValue != resultValue { + if !fixedDecimalsAreEqual(expectedValue, resultValue) { t.Errorf("expected %v got %v", expectedValue, resultValue) } expectedValue = *expected.AbsoluteBounds[i].Maximum resultValue = *b.Maximum - if expectedValue != resultValue { + if !fixedDecimalsAreEqual(expectedValue, resultValue) { t.Errorf("expected %v got %v", expectedValue, resultValue) } } @@ -100,13 +102,13 @@ func TestDevicesConfig_LoadFromFile(t *testing.T) { if expected.RecommendedBounds != nil { expectedValue := *expected.RecommendedBounds.Minimum resultValue := *result.RecommendedBounds.Minimum - if expectedValue != resultValue { + if !fixedDecimalsAreEqual(expectedValue, resultValue) { t.Errorf("expected %v got %v", expectedValue, resultValue) } expectedValue = *expected.RecommendedBounds.Maximum resultValue = *result.RecommendedBounds.Maximum - if expectedValue != resultValue { + if !fixedDecimalsAreEqual(expectedValue, resultValue) { t.Errorf("expected %v got %v", expectedValue, resultValue) } } @@ -118,16 +120,16 @@ func TestDevicesConfig_LoadFromFile(t *testing.T) { AbsoluteBounds: []*AbsoluteBounds{ &AbsoluteBounds{ Bounds: Bounds{ - Minimum: pointerFromFloat(54), - Maximum: pointerFromFloat(180), + Minimum: &FixedDecimal{Units: 54}, + Maximum: &FixedDecimal{Units: 180}, }, - Increment: 1, + Increment: &FixedDecimal{Units: 1}, }, }, RecommendedBounds: &RecommendedBounds{ Bounds{ - Minimum: pointerFromFloat(71), - Maximum: pointerFromFloat(119), + Minimum: &FixedDecimal{Units: 71}, + Maximum: &FixedDecimal{Units: 119}, }, }, }) @@ -139,16 +141,16 @@ func TestDevicesConfig_LoadFromFile(t *testing.T) { AbsoluteBounds: []*AbsoluteBounds{ &AbsoluteBounds{ Bounds: Bounds{ - Minimum: pointerFromFloat(10), - Maximum: pointerFromFloat(500), + Minimum: &FixedDecimal{Units: 10}, + Maximum: &FixedDecimal{Units: 500}, }, - Increment: 1, + Increment: &FixedDecimal{Units: 1}, }, }, RecommendedBounds: &RecommendedBounds{ Bounds{ - Minimum: pointerFromFloat(16), - Maximum: pointerFromFloat(399), + Minimum: &FixedDecimal{Units: 16}, + Maximum: &FixedDecimal{Units: 399}, }, }, }) @@ -156,14 +158,14 @@ func TestDevicesConfig_LoadFromFile(t *testing.T) { t.Run("Basal rates is correct", func(t *testing.T) { isExpected(t, omnipod.GuardRails.BasalRates, GuardRail{ Units: "U/h", - DefaultValue: pointerFromFloat(0.05), + DefaultValue: &FixedDecimal{Nanos: 50000000}, AbsoluteBounds: []*AbsoluteBounds{ &AbsoluteBounds{ Bounds: Bounds{ - Minimum: pointerFromFloat(0.05), - Maximum: pointerFromFloat(30.0), + Minimum: &FixedDecimal{Nanos: 50000000}, + Maximum: &FixedDecimal{Units: 30}, }, - Increment: 0.05, + Increment: &FixedDecimal{Nanos: 50000000}, }, }, RecommendedBounds: nil, @@ -176,16 +178,16 @@ func TestDevicesConfig_LoadFromFile(t *testing.T) { AbsoluteBounds: []*AbsoluteBounds{ &AbsoluteBounds{ Bounds: Bounds{ - Minimum: pointerFromFloat(1.0), - Maximum: pointerFromFloat(150.0), + Minimum: &FixedDecimal{Units: 1}, + Maximum: &FixedDecimal{Units: 150}, }, - Increment: 0.01, + Increment: &FixedDecimal{Nanos: 10000000}, }, }, RecommendedBounds: &RecommendedBounds{ Bounds{ - Minimum: pointerFromFloat(3.01), - Maximum: pointerFromFloat(26.99), + Minimum: &FixedDecimal{Units: 3, Nanos: 10000000}, + Maximum: &FixedDecimal{Units: 26, Nanos: 990000000}, }, }, }) @@ -193,14 +195,14 @@ func TestDevicesConfig_LoadFromFile(t *testing.T) { t.Run("Basal rate maximum is correct", func(t *testing.T) { isExpected(t, omnipod.GuardRails.BasalRateMaximum, GuardRail{ Units: "U/h", - DefaultValue: pointerFromFloat(0.0), + DefaultValue: &FixedDecimal{Units: 0}, AbsoluteBounds: []*AbsoluteBounds{ &AbsoluteBounds{ Bounds: Bounds{ - Minimum: pointerFromFloat(0.0), - Maximum: pointerFromFloat(30.0), + Minimum: &FixedDecimal{Units: 0}, + Maximum: &FixedDecimal{Units: 30}, }, - Increment: 0.05, + Increment: &FixedDecimal{Nanos: 50000000}, }, }, RecommendedBounds: nil, @@ -209,20 +211,20 @@ func TestDevicesConfig_LoadFromFile(t *testing.T) { t.Run("Bolus amount maximum is correct", func(t *testing.T) { isExpected(t, omnipod.GuardRails.BolusAmountMaximum, GuardRail{ Units: "U", - DefaultValue: pointerFromFloat(0.0), + DefaultValue: &FixedDecimal{Units: 0}, AbsoluteBounds: []*AbsoluteBounds{ &AbsoluteBounds{ Bounds: Bounds{ - Minimum: pointerFromFloat(0.0), - Maximum: pointerFromFloat(30.0), + Minimum: &FixedDecimal{Units: 0}, + Maximum: &FixedDecimal{Units: 30}, }, - Increment: 0.05, + Increment: &FixedDecimal{Nanos: 50000000}, }, }, RecommendedBounds: &RecommendedBounds{ Bounds{ - Minimum: pointerFromFloat(0.05), - Maximum: pointerFromFloat(19.95), + Minimum: &FixedDecimal{Nanos: 50000000}, + Maximum: &FixedDecimal{Units: 19, Nanos: 950000000}, }, }, }) @@ -233,16 +235,16 @@ func TestDevicesConfig_LoadFromFile(t *testing.T) { AbsoluteBounds: []*AbsoluteBounds{ &AbsoluteBounds{ Bounds: Bounds{ - Minimum: pointerFromFloat(60.0), - Maximum: pointerFromFloat(180.0), + Minimum: &FixedDecimal{Units: 60}, + Maximum: &FixedDecimal{Units: 180}, }, - Increment: 1.0, + Increment: &FixedDecimal{Units: 1}, }, }, RecommendedBounds: &RecommendedBounds{ Bounds{ - Minimum: pointerFromFloat(70.0), - Maximum: pointerFromFloat(120.0), + Minimum: &FixedDecimal{Units: 70}, + Maximum: &FixedDecimal{Units: 120}, }, }, }) diff --git a/repo/pumps_config.go b/repo/pumps_config.go index c3ebf33..e12bdeb 100644 --- a/repo/pumps_config.go +++ b/repo/pumps_config.go @@ -122,7 +122,10 @@ func PopulateBasalRatesFromConfig(cfg config.GuardRail, guardRail *api.BasalRate } guardRail.Units = api.BasalRateUnits_UnitsPerHour - guardRail.DefaultValue = *cfg.DefaultValue + guardRail.DefaultValue = &api.FixedDecimal{ + Units: cfg.DefaultValue.Units, + Nanos: cfg.DefaultValue.Nanos, + } guardRail.AbsoluteBounds = make([]*api.AbsoluteBounds, len(cfg.AbsoluteBounds)) if err := PopulateAbsoluteBoundsArrayFromConfig(cfg.AbsoluteBounds, guardRail.AbsoluteBounds); err != nil { @@ -160,7 +163,10 @@ func PopulateBasalRateMaximumFromConfig(cfg config.GuardRail, guardRail *api.Bas } guardRail.Units = api.BasalRateUnits_UnitsPerHour - guardRail.DefaultValue = *cfg.DefaultValue + guardRail.DefaultValue = &api.FixedDecimal{ + Units: cfg.DefaultValue.Units, + Nanos: cfg.DefaultValue.Nanos, + } guardRail.AbsoluteBounds = &api.AbsoluteBounds{} if err := PopulateAbsoluteBoundsFromFirstConfigValue(cfg.AbsoluteBounds, guardRail.AbsoluteBounds); err != nil { @@ -179,7 +185,10 @@ func PopulateBolusAmountMaximumFromConfig(cfg config.GuardRail, guardRail *api.B } guardRail.Units = api.BolusUnits_Units - guardRail.DefaultValue = *cfg.DefaultValue + guardRail.DefaultValue = &api.FixedDecimal{ + Units: cfg.DefaultValue.Units, + Nanos: cfg.DefaultValue.Nanos, + } guardRail.RecommendedBounds = &api.RecommendedBounds{} guardRail.AbsoluteBounds = &api.AbsoluteBounds{} @@ -217,8 +226,14 @@ func PopulateRecommendedBoundsFromConfig(bounds *config.RecommendedBounds, recom return errors.New("recommended bounds cannot be empty") } - recommendedBounds.Minimum = *bounds.Minimum - recommendedBounds.Maximum = *bounds.Maximum + recommendedBounds.Minimum = &api.FixedDecimal{ + Units: bounds.Minimum.Units, + Nanos: bounds.Minimum.Nanos, + } + recommendedBounds.Maximum = &api.FixedDecimal{ + Units: bounds.Maximum.Units, + Nanos: bounds.Maximum.Nanos, + } return nil } @@ -227,9 +242,18 @@ func PopulateAbsoluteBoundsFromFirstConfigValue(bounds []*config.AbsoluteBounds, return errors.New("absolute bounds is empty") } - absoluteBounds.Minimum = *bounds[0].Minimum - absoluteBounds.Maximum = *bounds[0].Maximum - absoluteBounds.Increment = bounds[0].Increment + absoluteBounds.Minimum = &api.FixedDecimal{ + Units: bounds[0].Minimum.Units, + Nanos: bounds[0].Minimum.Nanos, + } + absoluteBounds.Maximum = &api.FixedDecimal{ + Units: bounds[0].Maximum.Units, + Nanos: bounds[0].Maximum.Nanos, + } + absoluteBounds.Increment = &api.FixedDecimal{ + Units: bounds[0].Increment.Units, + Nanos: bounds[0].Increment.Nanos, + } return nil } @@ -240,13 +264,21 @@ func PopulateAbsoluteBoundsArrayFromConfig(bounds []*config.AbsoluteBounds, abso for i, b := range bounds { result := &api.AbsoluteBounds{ - Minimum: *b.Minimum, - Maximum: *b.Maximum, - Increment: b.Increment, + Minimum: &api.FixedDecimal{ + Units: b.Minimum.Units, + Nanos: b.Minimum.Nanos, + }, + Maximum: &api.FixedDecimal{ + Units: b.Maximum.Units, + Nanos: b.Maximum.Nanos, + }, + Increment: &api.FixedDecimal{ + Units: b.Increment.Units, + Nanos: b.Increment.Nanos, + }, } absoluteBounds[i] = result } return nil } -