From 0e4169c77c4876926824af54d451c0f9d7347cbe Mon Sep 17 00:00:00 2001 From: James Reategui Date: Fri, 16 May 2025 13:14:35 -0400 Subject: [PATCH 1/2] update protobuf --- pkg/grpc/decoder.pb.go | 135 +++++++++++++++++++----------------- pkg/grpc/decoder.proto | 9 +-- pkg/grpc/decoder_grpc.pb.go | 30 ++++---- 3 files changed, 91 insertions(+), 83 deletions(-) diff --git a/pkg/grpc/decoder.pb.go b/pkg/grpc/decoder.pb.go index c1bb842d..3e17ca39 100644 --- a/pkg/grpc/decoder.pb.go +++ b/pkg/grpc/decoder.pb.go @@ -26,10 +26,12 @@ type DecodeVinRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Vin string `protobuf:"bytes,1,opt,name=vin,proto3" json:"vin,omitempty"` - Country string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"` + Vin string `protobuf:"bytes,1,opt,name=vin,proto3" json:"vin,omitempty"` + Country string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"` + // Deprecated: Marked as deprecated in pkg/grpc/decoder.proto. KnownModel string `protobuf:"bytes,3,opt,name=known_model,json=knownModel,proto3" json:"known_model,omitempty"` - KnownYear int32 `protobuf:"varint,4,opt,name=known_year,json=knownYear,proto3" json:"known_year,omitempty"` + // Deprecated: Marked as deprecated in pkg/grpc/decoder.proto. + KnownYear int32 `protobuf:"varint,4,opt,name=known_year,json=knownYear,proto3" json:"known_year,omitempty"` } func (x *DecodeVinRequest) Reset() { @@ -78,6 +80,7 @@ func (x *DecodeVinRequest) GetCountry() string { return "" } +// Deprecated: Marked as deprecated in pkg/grpc/decoder.proto. func (x *DecodeVinRequest) GetKnownModel() string { if x != nil { return x.KnownModel @@ -85,6 +88,7 @@ func (x *DecodeVinRequest) GetKnownModel() string { return "" } +// Deprecated: Marked as deprecated in pkg/grpc/decoder.proto. func (x *DecodeVinRequest) GetKnownYear() int32 { if x != nil { return x.KnownYear @@ -206,7 +210,7 @@ func (x *DecodeVinResponse) GetManufacturer() string { return "" } -type ChangeDecodingRequest struct { +type UpsertDecodingRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -215,8 +219,8 @@ type ChangeDecodingRequest struct { TargetDefinitionId string `protobuf:"bytes,2,opt,name=target_definition_id,json=targetDefinitionId,proto3" json:"target_definition_id,omitempty"` } -func (x *ChangeDecodingRequest) Reset() { - *x = ChangeDecodingRequest{} +func (x *UpsertDecodingRequest) Reset() { + *x = UpsertDecodingRequest{} if protoimpl.UnsafeEnabled { mi := &file_pkg_grpc_decoder_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -224,13 +228,13 @@ func (x *ChangeDecodingRequest) Reset() { } } -func (x *ChangeDecodingRequest) String() string { +func (x *UpsertDecodingRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ChangeDecodingRequest) ProtoMessage() {} +func (*UpsertDecodingRequest) ProtoMessage() {} -func (x *ChangeDecodingRequest) ProtoReflect() protoreflect.Message { +func (x *UpsertDecodingRequest) ProtoReflect() protoreflect.Message { mi := &file_pkg_grpc_decoder_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -242,19 +246,19 @@ func (x *ChangeDecodingRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ChangeDecodingRequest.ProtoReflect.Descriptor instead. -func (*ChangeDecodingRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use UpsertDecodingRequest.ProtoReflect.Descriptor instead. +func (*UpsertDecodingRequest) Descriptor() ([]byte, []int) { return file_pkg_grpc_decoder_proto_rawDescGZIP(), []int{2} } -func (x *ChangeDecodingRequest) GetVin() string { +func (x *UpsertDecodingRequest) GetVin() string { if x != nil { return x.Vin } return "" } -func (x *ChangeDecodingRequest) GetTargetDefinitionId() string { +func (x *UpsertDecodingRequest) GetTargetDefinitionId() string { if x != nil { return x.TargetDefinitionId } @@ -267,54 +271,55 @@ var file_pkg_grpc_decoder_proto_rawDesc = []byte{ 0x0a, 0x16, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7e, 0x0a, 0x10, 0x44, - 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x10, 0x0a, 0x03, 0x76, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, 0x69, - 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6b, - 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, - 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x79, 0x65, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x09, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x59, 0x65, 0x61, 0x72, 0x22, 0xb2, 0x02, 0x0a, 0x11, - 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x28, 0x0a, 0x0e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x61, 0x6b, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0c, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6b, 0x65, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, - 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x65, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x04, 0x79, 0x65, 0x61, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x1e, 0x0a, 0x0a, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x12, - 0x20, 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, 0x74, 0x72, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x65, 0x77, 0x54, 0x72, 0x78, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x22, 0x0a, 0x0c, - 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, - 0x22, 0x5b, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x69, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, 0x69, 0x6e, 0x12, 0x30, 0x0a, 0x14, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x32, 0x98, 0x01, - 0x0a, 0x11, 0x56, 0x69, 0x6e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, 0x6e, - 0x12, 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x45, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x65, 0x63, 0x6f, 0x64, - 0x69, 0x6e, 0x67, 0x12, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x49, 0x4d, 0x4f, 0x2d, 0x4e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2d, 0x64, 0x65, 0x66, 0x69, 0x6e, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, - 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x86, 0x01, 0x0a, 0x10, + 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x76, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, + 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x23, 0x0a, 0x0b, + 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x4d, 0x6f, 0x64, 0x65, + 0x6c, 0x12, 0x21, 0x0a, 0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x79, 0x65, 0x61, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x02, 0x18, 0x01, 0x52, 0x09, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, + 0x59, 0x65, 0x61, 0x72, 0x22, 0xb2, 0x02, 0x0a, 0x11, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, + 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x0e, 0x64, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x61, 0x6b, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0c, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, + 0x6b, 0x65, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, + 0x74, 0x79, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x79, 0x65, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x79, 0x65, 0x61, 0x72, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6f, 0x77, 0x65, + 0x72, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, + 0x77, 0x65, 0x72, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, + 0x74, 0x72, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x6e, 0x65, 0x77, 0x54, 0x72, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, + 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, + 0x74, 0x75, 0x72, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x61, 0x6e, + 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x22, 0x5b, 0x0a, 0x15, 0x55, 0x70, 0x73, + 0x65, 0x72, 0x74, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x76, 0x69, 0x6e, 0x12, 0x30, 0x0a, 0x14, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x64, + 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x12, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x32, 0x98, 0x01, 0x0a, 0x11, 0x56, 0x69, 0x6e, 0x44, 0x65, + 0x63, 0x6f, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x09, + 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, + 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0e, 0x55, 0x70, + 0x73, 0x65, 0x72, 0x74, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x1b, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x44, 0x49, 0x4d, 0x4f, 0x2d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x2d, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2d, + 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -333,14 +338,14 @@ var file_pkg_grpc_decoder_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_pkg_grpc_decoder_proto_goTypes = []interface{}{ (*DecodeVinRequest)(nil), // 0: grpc.DecodeVinRequest (*DecodeVinResponse)(nil), // 1: grpc.DecodeVinResponse - (*ChangeDecodingRequest)(nil), // 2: grpc.ChangeDecodingRequest + (*UpsertDecodingRequest)(nil), // 2: grpc.UpsertDecodingRequest (*emptypb.Empty)(nil), // 3: google.protobuf.Empty } var file_pkg_grpc_decoder_proto_depIdxs = []int32{ 0, // 0: grpc.VinDecoderService.DecodeVin:input_type -> grpc.DecodeVinRequest - 2, // 1: grpc.VinDecoderService.ChangeDecoding:input_type -> grpc.ChangeDecodingRequest + 2, // 1: grpc.VinDecoderService.UpsertDecoding:input_type -> grpc.UpsertDecodingRequest 1, // 2: grpc.VinDecoderService.DecodeVin:output_type -> grpc.DecodeVinResponse - 3, // 3: grpc.VinDecoderService.ChangeDecoding:output_type -> google.protobuf.Empty + 3, // 3: grpc.VinDecoderService.UpsertDecoding:output_type -> google.protobuf.Empty 2, // [2:4] is the sub-list for method output_type 0, // [0:2] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -379,7 +384,7 @@ func file_pkg_grpc_decoder_proto_init() { } } file_pkg_grpc_decoder_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeDecodingRequest); i { + switch v := v.(*UpsertDecodingRequest); i { case 0: return &v.state case 1: diff --git a/pkg/grpc/decoder.proto b/pkg/grpc/decoder.proto index 8f58a3ef..e316c9c3 100644 --- a/pkg/grpc/decoder.proto +++ b/pkg/grpc/decoder.proto @@ -9,8 +9,8 @@ package grpc; message DecodeVinRequest { string vin = 1; string country = 2; - string known_model = 3; - int32 known_year = 4; + string known_model = 3 [deprecated=true]; + int32 known_year = 4 [deprecated=true]; } message DecodeVinResponse { @@ -26,12 +26,13 @@ message DecodeVinResponse { string manufacturer = 11; } -message ChangeDecodingRequest { +message UpsertDecodingRequest { string vin = 1; string target_definition_id = 2; } service VinDecoderService { rpc DecodeVin(DecodeVinRequest) returns (DecodeVinResponse); - rpc ChangeDecoding(ChangeDecodingRequest) returns (google.protobuf.Empty); + // used to change what a vin points to or insert a new vin to definition id mapping + rpc UpsertDecoding(UpsertDecodingRequest) returns (google.protobuf.Empty); } diff --git a/pkg/grpc/decoder_grpc.pb.go b/pkg/grpc/decoder_grpc.pb.go index b2ba0200..0f2df787 100644 --- a/pkg/grpc/decoder_grpc.pb.go +++ b/pkg/grpc/decoder_grpc.pb.go @@ -21,7 +21,7 @@ const _ = grpc.SupportPackageIsVersion7 const ( VinDecoderService_DecodeVin_FullMethodName = "/grpc.VinDecoderService/DecodeVin" - VinDecoderService_ChangeDecoding_FullMethodName = "/grpc.VinDecoderService/ChangeDecoding" + VinDecoderService_UpsertDecoding_FullMethodName = "/grpc.VinDecoderService/UpsertDecoding" ) // VinDecoderServiceClient is the client API for VinDecoderService service. @@ -29,7 +29,8 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type VinDecoderServiceClient interface { DecodeVin(ctx context.Context, in *DecodeVinRequest, opts ...grpc.CallOption) (*DecodeVinResponse, error) - ChangeDecoding(ctx context.Context, in *ChangeDecodingRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // used to change what a vin points to or insert a new vin to definition id mapping + UpsertDecoding(ctx context.Context, in *UpsertDecodingRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } type vinDecoderServiceClient struct { @@ -49,9 +50,9 @@ func (c *vinDecoderServiceClient) DecodeVin(ctx context.Context, in *DecodeVinRe return out, nil } -func (c *vinDecoderServiceClient) ChangeDecoding(ctx context.Context, in *ChangeDecodingRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *vinDecoderServiceClient) UpsertDecoding(ctx context.Context, in *UpsertDecodingRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, VinDecoderService_ChangeDecoding_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, VinDecoderService_UpsertDecoding_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -63,7 +64,8 @@ func (c *vinDecoderServiceClient) ChangeDecoding(ctx context.Context, in *Change // for forward compatibility type VinDecoderServiceServer interface { DecodeVin(context.Context, *DecodeVinRequest) (*DecodeVinResponse, error) - ChangeDecoding(context.Context, *ChangeDecodingRequest) (*emptypb.Empty, error) + // used to change what a vin points to or insert a new vin to definition id mapping + UpsertDecoding(context.Context, *UpsertDecodingRequest) (*emptypb.Empty, error) mustEmbedUnimplementedVinDecoderServiceServer() } @@ -74,8 +76,8 @@ type UnimplementedVinDecoderServiceServer struct { func (UnimplementedVinDecoderServiceServer) DecodeVin(context.Context, *DecodeVinRequest) (*DecodeVinResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DecodeVin not implemented") } -func (UnimplementedVinDecoderServiceServer) ChangeDecoding(context.Context, *ChangeDecodingRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChangeDecoding not implemented") +func (UnimplementedVinDecoderServiceServer) UpsertDecoding(context.Context, *UpsertDecodingRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpsertDecoding not implemented") } func (UnimplementedVinDecoderServiceServer) mustEmbedUnimplementedVinDecoderServiceServer() {} @@ -108,20 +110,20 @@ func _VinDecoderService_DecodeVin_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } -func _VinDecoderService_ChangeDecoding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangeDecodingRequest) +func _VinDecoderService_UpsertDecoding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpsertDecodingRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(VinDecoderServiceServer).ChangeDecoding(ctx, in) + return srv.(VinDecoderServiceServer).UpsertDecoding(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: VinDecoderService_ChangeDecoding_FullMethodName, + FullMethod: VinDecoderService_UpsertDecoding_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VinDecoderServiceServer).ChangeDecoding(ctx, req.(*ChangeDecodingRequest)) + return srv.(VinDecoderServiceServer).UpsertDecoding(ctx, req.(*UpsertDecodingRequest)) } return interceptor(ctx, in, info, handler) } @@ -138,8 +140,8 @@ var VinDecoderService_ServiceDesc = grpc.ServiceDesc{ Handler: _VinDecoderService_DecodeVin_Handler, }, { - MethodName: "ChangeDecoding", - Handler: _VinDecoderService_ChangeDecoding_Handler, + MethodName: "UpsertDecoding", + Handler: _VinDecoderService_UpsertDecoding_Handler, }, }, Streams: []grpc.StreamDesc{}, From 2121730a4583f2f5e422fecc6994dd26a5ab8fef Mon Sep 17 00:00:00 2001 From: James Reategui Date: Fri, 16 May 2025 13:36:40 -0400 Subject: [PATCH 2/2] grpc upsert vin impl --- internal/api/api.go | 2 + internal/api/grpc_vin_decoder_service.go | 13 +++ internal/core/queries/upsert_vin_decode.go | 84 ++++++++++++++++ pkg/grpc/decoder.pb.go | 107 ++++++++++----------- pkg/grpc/decoder.proto | 4 +- 5 files changed, 152 insertions(+), 58 deletions(-) create mode 100644 internal/core/queries/upsert_vin_decode.go diff --git a/internal/api/api.go b/internal/api/api.go index 66704c6f..6c03621c 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -132,6 +132,8 @@ func Run(ctx context.Context, logger zerolog.Logger, settings *config.Settings, mediator.WithHandler(&queries.GetCompatibilityR1SheetQuery{}, queries.NewCompatibilityR1SheetQueryHandler(settings)), mediator.WithHandler(&queries.GetDeviceDefinitionByIDQueryV2{}, queries.NewGetDeviceDefinitionByIDQueryV2Handler(ddOnChainService, pdb.DBS)), mediator.WithHandler(&queries.GetVINProfileQuery{}, queries.NewGetVINProfileQueryHandler(pdb.DBS, &logger)), + + mediator.WithHandler(&queries.UpsertDecodingQuery{}, queries.NewUpsertDecodingQueryHandler(pdb.DBS, &logger, ddOnChainService)), ) //fiber diff --git a/internal/api/grpc_vin_decoder_service.go b/internal/api/grpc_vin_decoder_service.go index c2e52d72..7db34e8c 100644 --- a/internal/api/grpc_vin_decoder_service.go +++ b/internal/api/grpc_vin_decoder_service.go @@ -3,6 +3,8 @@ package api import ( "context" + "google.golang.org/protobuf/types/known/emptypb" + "github.com/DIMO-Network/device-definitions-api/internal/core/mediator" "github.com/DIMO-Network/device-definitions-api/internal/core/queries" p_grpc "github.com/DIMO-Network/device-definitions-api/pkg/grpc" @@ -34,3 +36,14 @@ func (s *GrpcVinDecoderService) DecodeVin(ctx context.Context, in *p_grpc.Decode return result, nil } + +func (s *GrpcVinDecoderService) UpsertDecoding(ctx context.Context, in *p_grpc.UpsertDecodingRequest) (*emptypb.Empty, error) { + _, err := s.Mediator.Send(ctx, &queries.UpsertDecodingQuery{ + VIN: in.Vin, + DefinitionID: in.TargetDefinitionId, + }) + if err != nil { + return nil, err + } + return &emptypb.Empty{}, nil +} diff --git a/internal/core/queries/upsert_vin_decode.go b/internal/core/queries/upsert_vin_decode.go new file mode 100644 index 00000000..f991e25b --- /dev/null +++ b/internal/core/queries/upsert_vin_decode.go @@ -0,0 +1,84 @@ +package queries + +import ( + "context" + "fmt" + + "github.com/DIMO-Network/device-definitions-api/internal/core/mediator" + "github.com/DIMO-Network/device-definitions-api/internal/infrastructure/db/models" + "github.com/DIMO-Network/device-definitions-api/internal/infrastructure/exceptions" + "github.com/DIMO-Network/device-definitions-api/internal/infrastructure/gateways" + "github.com/DIMO-Network/shared/pkg/db" + "github.com/DIMO-Network/shared/pkg/logfields" + vinutils "github.com/DIMO-Network/shared/pkg/vin" + "github.com/pkg/errors" + "github.com/rs/zerolog" + "github.com/volatiletech/null/v8" + "github.com/volatiletech/sqlboiler/v4/boil" +) + +type UpsertDecodingQueryHandler struct { + dbs func() *db.ReaderWriter + logger *zerolog.Logger + deviceDefinitionOnChainService gateways.DeviceDefinitionOnChainService +} + +type UpsertDecodingQuery struct { + VIN string `json:"vin"` + DefinitionID string `json:"definitionId"` +} + +func (*UpsertDecodingQuery) Key() string { return "UpsertDecodingQuery" } + +func NewUpsertDecodingQueryHandler(dbs func() *db.ReaderWriter, + logger *zerolog.Logger, + deviceDefinitionOnChainService gateways.DeviceDefinitionOnChainService) UpsertDecodingQueryHandler { + return UpsertDecodingQueryHandler{ + dbs: dbs, + logger: logger, + deviceDefinitionOnChainService: deviceDefinitionOnChainService, + } +} + +func (dc UpsertDecodingQueryHandler) Handle(ctx context.Context, query mediator.Message) (interface{}, error) { + qry := query.(*UpsertDecodingQuery) + if len(qry.VIN) < 10 || len(qry.VIN) > 17 { + return nil, &exceptions.ValidationError{Err: fmt.Errorf("invalid vin %s", qry.VIN)} + } + vin := vinutils.VIN(qry.VIN) + wmi := vin.Wmi() + + localLog := dc.logger.With(). + Str("vin", vin.String()). + Str("handler", query.Key()). + Logger() + + // check if the definition id exists on chain + dd, manuf, err := dc.deviceDefinitionOnChainService.GetDefinitionByID(ctx, qry.DefinitionID) + if err != nil { + return nil, errors.Wrapf(err, "failed to find device definition by id %s when upserting vin decoding", qry.DefinitionID) + } + manufacturerName, err := dc.deviceDefinitionOnChainService.GetManufacturerNameByID(ctx, manuf) + if err != nil { + return nil, errors.Wrapf(err, "failed to find manufacturer name by id %s when upserting vin decoding", manuf) + } + //upsert the vin + vinNumber := &models.VinNumber{ + Vin: qry.VIN, + Wmi: null.StringFrom(wmi), + VDS: null.StringFrom(vin.VDS()), + CheckDigit: null.StringFrom(vin.CheckDigit()), + SerialNumber: vin.SerialNumber(), + Vis: null.StringFrom(vin.VIS()), + DecodeProvider: null.StringFrom("manual entry"), + Year: dd.Year, + DefinitionID: dd.ID, + ManufacturerName: manufacturerName, + } + err = vinNumber.Upsert(ctx, dc.dbs().Writer, true, []string{"vin"}, boil.Infer(), boil.Infer()) + if err != nil { + return nil, errors.Wrapf(err, "failed to upsert vin number %s for manual update", qry.VIN) + } + localLog.Info().Str(logfields.VIN, qry.VIN).Str(logfields.FunctionName, qry.Key()).Msg("manually upserted new vin number") + return nil, nil +} diff --git a/pkg/grpc/decoder.pb.go b/pkg/grpc/decoder.pb.go index 3e17ca39..cbcb6b2d 100644 --- a/pkg/grpc/decoder.pb.go +++ b/pkg/grpc/decoder.pb.go @@ -26,12 +26,10 @@ type DecodeVinRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Vin string `protobuf:"bytes,1,opt,name=vin,proto3" json:"vin,omitempty"` - Country string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"` - // Deprecated: Marked as deprecated in pkg/grpc/decoder.proto. + Vin string `protobuf:"bytes,1,opt,name=vin,proto3" json:"vin,omitempty"` + Country string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"` KnownModel string `protobuf:"bytes,3,opt,name=known_model,json=knownModel,proto3" json:"known_model,omitempty"` - // Deprecated: Marked as deprecated in pkg/grpc/decoder.proto. - KnownYear int32 `protobuf:"varint,4,opt,name=known_year,json=knownYear,proto3" json:"known_year,omitempty"` + KnownYear int32 `protobuf:"varint,4,opt,name=known_year,json=knownYear,proto3" json:"known_year,omitempty"` } func (x *DecodeVinRequest) Reset() { @@ -80,7 +78,6 @@ func (x *DecodeVinRequest) GetCountry() string { return "" } -// Deprecated: Marked as deprecated in pkg/grpc/decoder.proto. func (x *DecodeVinRequest) GetKnownModel() string { if x != nil { return x.KnownModel @@ -88,7 +85,6 @@ func (x *DecodeVinRequest) GetKnownModel() string { return "" } -// Deprecated: Marked as deprecated in pkg/grpc/decoder.proto. func (x *DecodeVinRequest) GetKnownYear() int32 { if x != nil { return x.KnownYear @@ -271,55 +267,54 @@ var file_pkg_grpc_decoder_proto_rawDesc = []byte{ 0x0a, 0x16, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x86, 0x01, 0x0a, 0x10, - 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x10, 0x0a, 0x03, 0x76, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, - 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x23, 0x0a, 0x0b, - 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x4d, 0x6f, 0x64, 0x65, - 0x6c, 0x12, 0x21, 0x0a, 0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x79, 0x65, 0x61, 0x72, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x02, 0x18, 0x01, 0x52, 0x09, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, - 0x59, 0x65, 0x61, 0x72, 0x22, 0xb2, 0x02, 0x0a, 0x11, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, - 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x0e, 0x64, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x61, 0x6b, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0c, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, - 0x6b, 0x65, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, - 0x74, 0x79, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x79, 0x65, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x79, 0x65, 0x61, 0x72, - 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6f, 0x77, 0x65, - 0x72, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, - 0x77, 0x65, 0x72, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, - 0x74, 0x72, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x6e, 0x65, 0x77, 0x54, 0x72, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, - 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, - 0x74, 0x75, 0x72, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x61, 0x6e, - 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x22, 0x5b, 0x0a, 0x15, 0x55, 0x70, 0x73, - 0x65, 0x72, 0x74, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x76, 0x69, 0x6e, 0x12, 0x30, 0x0a, 0x14, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x64, - 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x12, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x32, 0x98, 0x01, 0x0a, 0x11, 0x56, 0x69, 0x6e, 0x44, 0x65, - 0x63, 0x6f, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x09, - 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, - 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0e, 0x55, 0x70, - 0x73, 0x65, 0x72, 0x74, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x1b, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x44, 0x49, 0x4d, 0x4f, 0x2d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x64, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x2d, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2d, - 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7e, 0x0a, 0x10, 0x44, + 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x10, 0x0a, 0x03, 0x76, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, 0x69, + 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6b, + 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, + 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x79, 0x65, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x59, 0x65, 0x61, 0x72, 0x22, 0xb2, 0x02, 0x0a, 0x11, + 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x28, 0x0a, 0x0e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x61, 0x6b, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0c, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6b, 0x65, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, + 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x65, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x79, 0x65, 0x61, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x1e, 0x0a, 0x0a, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x12, + 0x20, 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, 0x74, 0x72, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x65, 0x77, 0x54, 0x72, 0x78, 0x48, 0x61, 0x73, + 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x22, 0x0a, 0x0c, + 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, + 0x22, 0x5b, 0x0a, 0x15, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x69, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, 0x69, 0x6e, 0x12, 0x30, 0x0a, 0x14, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x32, 0x98, 0x01, + 0x0a, 0x11, 0x56, 0x69, 0x6e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, 0x6e, + 0x12, 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x45, 0x0a, 0x0e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x44, 0x65, 0x63, 0x6f, 0x64, + 0x69, 0x6e, 0x67, 0x12, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, + 0x74, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x49, 0x4d, 0x4f, 0x2d, 0x4e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2d, 0x64, 0x65, 0x66, 0x69, 0x6e, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, + 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/grpc/decoder.proto b/pkg/grpc/decoder.proto index e316c9c3..12bd6f88 100644 --- a/pkg/grpc/decoder.proto +++ b/pkg/grpc/decoder.proto @@ -9,8 +9,8 @@ package grpc; message DecodeVinRequest { string vin = 1; string country = 2; - string known_model = 3 [deprecated=true]; - int32 known_year = 4 [deprecated=true]; + string known_model = 3; + int32 known_year = 4; } message DecodeVinResponse {