From 98e3d5073ce3cf9e3b9f86b87ac47b64a1926c36 Mon Sep 17 00:00:00 2001 From: jeffyanta Date: Wed, 13 May 2026 13:05:24 -0400 Subject: [PATCH] Add Contact List service --- README.md | 1 + .../go/contact/v1/contact_list_service.pb.go | 1072 ++++++++++++ .../v1/contact_list_service.pb.validate.go | 1538 +++++++++++++++++ .../v1/contact_list_service_grpc.pb.go | 318 ++++ generated/go/contact/v1/model.pb.go | 240 +++ generated/go/contact/v1/model.pb.validate.go | 400 +++++ .../v1/contact_list_service_connect.ts | 91 + .../contact/v1/contact_list_service_pb.ts | 584 +++++++ generated/protobuf-es/contact/v1/index.ts | 3 + generated/protobuf-es/contact/v1/model_pb.ts | 106 ++ generated/protobuf-es/index.ts | 2 + proto/contact/v1/contact_list_service.proto | 146 ++ proto/contact/v1/model.proto | 25 + 13 files changed, 4526 insertions(+) create mode 100644 generated/go/contact/v1/contact_list_service.pb.go create mode 100644 generated/go/contact/v1/contact_list_service.pb.validate.go create mode 100644 generated/go/contact/v1/contact_list_service_grpc.pb.go create mode 100644 generated/go/contact/v1/model.pb.go create mode 100644 generated/go/contact/v1/model.pb.validate.go create mode 100644 generated/protobuf-es/contact/v1/contact_list_service_connect.ts create mode 100644 generated/protobuf-es/contact/v1/contact_list_service_pb.ts create mode 100644 generated/protobuf-es/contact/v1/index.ts create mode 100644 generated/protobuf-es/contact/v1/model_pb.ts create mode 100644 proto/contact/v1/contact_list_service.proto create mode 100644 proto/contact/v1/model.proto diff --git a/README.md b/README.md index 0d2fed2..b9f0df4 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ The APIs and models for communication between Flipcash clients and server. - [Account](https://github.com/code-payments/flipcash2-protobuf-api/blob/main/proto/account/v1/account_service.proto) - [Activity Feed](https://github.com/code-payments/flipcash2-protobuf-api/blob/main/proto/activity/v1/activity_feed_service.proto) +- [Contact List](https://github.com/code-payments/flipcash2-protobuf-api/blob/main/proto/contact/v1/contact_list_service.proto) - [Email Verification](https://github.com/code-payments/flipcash2-protobuf-api/blob/main/proto/email/v1/email_verification_service.proto) - [Event Streaming](https://github.com/code-payments/flipcash2-protobuf-api/blob/main/proto/event/v1/event_streaming_service.proto) - [IAP](https://github.com/code-payments/flipcash2-protobuf-api/blob/main/proto/iap/v1/iap_service.proto) diff --git a/generated/go/contact/v1/contact_list_service.pb.go b/generated/go/contact/v1/contact_list_service.pb.go new file mode 100644 index 0000000..cfdb808 --- /dev/null +++ b/generated/go/contact/v1/contact_list_service.pb.go @@ -0,0 +1,1072 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.21.12 +// source: contact/v1/contact_list_service.proto + +package contactpb + +import ( + v1 "github.com/code-payments/flipcash2-protobuf-api/generated/go/common/v1" + v11 "github.com/code-payments/flipcash2-protobuf-api/generated/go/phone/v1" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CheckSyncResponse_Result int32 + +const ( + CheckSyncResponse_OK CheckSyncResponse_Result = 0 + CheckSyncResponse_OUT_OF_SYNC CheckSyncResponse_Result = 1 +) + +// Enum value maps for CheckSyncResponse_Result. +var ( + CheckSyncResponse_Result_name = map[int32]string{ + 0: "OK", + 1: "OUT_OF_SYNC", + } + CheckSyncResponse_Result_value = map[string]int32{ + "OK": 0, + "OUT_OF_SYNC": 1, + } +) + +func (x CheckSyncResponse_Result) Enum() *CheckSyncResponse_Result { + p := new(CheckSyncResponse_Result) + *p = x + return p +} + +func (x CheckSyncResponse_Result) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CheckSyncResponse_Result) Descriptor() protoreflect.EnumDescriptor { + return file_contact_v1_contact_list_service_proto_enumTypes[0].Descriptor() +} + +func (CheckSyncResponse_Result) Type() protoreflect.EnumType { + return &file_contact_v1_contact_list_service_proto_enumTypes[0] +} + +func (x CheckSyncResponse_Result) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CheckSyncResponse_Result.Descriptor instead. +func (CheckSyncResponse_Result) EnumDescriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{1, 0} +} + +type DeltaUploadResponse_Result int32 + +const ( + DeltaUploadResponse_OK DeltaUploadResponse_Result = 0 + // Stored checksum matched neither old_checksum nor new_checksum. + // Client should call FullUpload to reconcile. + DeltaUploadResponse_CHECKSUM_DRIFT DeltaUploadResponse_Result = 1 +) + +// Enum value maps for DeltaUploadResponse_Result. +var ( + DeltaUploadResponse_Result_name = map[int32]string{ + 0: "OK", + 1: "CHECKSUM_DRIFT", + } + DeltaUploadResponse_Result_value = map[string]int32{ + "OK": 0, + "CHECKSUM_DRIFT": 1, + } +) + +func (x DeltaUploadResponse_Result) Enum() *DeltaUploadResponse_Result { + p := new(DeltaUploadResponse_Result) + *p = x + return p +} + +func (x DeltaUploadResponse_Result) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DeltaUploadResponse_Result) Descriptor() protoreflect.EnumDescriptor { + return file_contact_v1_contact_list_service_proto_enumTypes[1].Descriptor() +} + +func (DeltaUploadResponse_Result) Type() protoreflect.EnumType { + return &file_contact_v1_contact_list_service_proto_enumTypes[1] +} + +func (x DeltaUploadResponse_Result) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DeltaUploadResponse_Result.Descriptor instead. +func (DeltaUploadResponse_Result) EnumDescriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{3, 0} +} + +type FullUploadResponse_Result int32 + +const ( + FullUploadResponse_OK FullUploadResponse_Result = 0 + // Server's recomputed checksum did not match expected_checksum. + FullUploadResponse_CHECKSUM_MISMATCH FullUploadResponse_Result = 1 +) + +// Enum value maps for FullUploadResponse_Result. +var ( + FullUploadResponse_Result_name = map[int32]string{ + 0: "OK", + 1: "CHECKSUM_MISMATCH", + } + FullUploadResponse_Result_value = map[string]int32{ + "OK": 0, + "CHECKSUM_MISMATCH": 1, + } +) + +func (x FullUploadResponse_Result) Enum() *FullUploadResponse_Result { + p := new(FullUploadResponse_Result) + *p = x + return p +} + +func (x FullUploadResponse_Result) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FullUploadResponse_Result) Descriptor() protoreflect.EnumDescriptor { + return file_contact_v1_contact_list_service_proto_enumTypes[2].Descriptor() +} + +func (FullUploadResponse_Result) Type() protoreflect.EnumType { + return &file_contact_v1_contact_list_service_proto_enumTypes[2] +} + +func (x FullUploadResponse_Result) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FullUploadResponse_Result.Descriptor instead. +func (FullUploadResponse_Result) EnumDescriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{5, 0} +} + +type GetFlipcashContactsResponse_Result int32 + +const ( + GetFlipcashContactsResponse_OK GetFlipcashContactsResponse_Result = 0 + // Server checksum doesn't match client checksum. + GetFlipcashContactsResponse_CHECKSUM_DRIFT GetFlipcashContactsResponse_Result = 1 + GetFlipcashContactsResponse_NOT_FOUND GetFlipcashContactsResponse_Result = 2 +) + +// Enum value maps for GetFlipcashContactsResponse_Result. +var ( + GetFlipcashContactsResponse_Result_name = map[int32]string{ + 0: "OK", + 1: "CHECKSUM_DRIFT", + 2: "NOT_FOUND", + } + GetFlipcashContactsResponse_Result_value = map[string]int32{ + "OK": 0, + "CHECKSUM_DRIFT": 1, + "NOT_FOUND": 2, + } +) + +func (x GetFlipcashContactsResponse_Result) Enum() *GetFlipcashContactsResponse_Result { + p := new(GetFlipcashContactsResponse_Result) + *p = x + return p +} + +func (x GetFlipcashContactsResponse_Result) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GetFlipcashContactsResponse_Result) Descriptor() protoreflect.EnumDescriptor { + return file_contact_v1_contact_list_service_proto_enumTypes[3].Descriptor() +} + +func (GetFlipcashContactsResponse_Result) Type() protoreflect.EnumType { + return &file_contact_v1_contact_list_service_proto_enumTypes[3] +} + +func (x GetFlipcashContactsResponse_Result) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use GetFlipcashContactsResponse_Result.Descriptor instead. +func (GetFlipcashContactsResponse_Result) EnumDescriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{7, 0} +} + +type ConnectResponse_Result int32 + +const ( + ConnectResponse_OK ConnectResponse_Result = 0 + ConnectResponse_DENIED ConnectResponse_Result = 1 + ConnectResponse_VERIFICATION_KEY_NOT_FOUND ConnectResponse_Result = 2 +) + +// Enum value maps for ConnectResponse_Result. +var ( + ConnectResponse_Result_name = map[int32]string{ + 0: "OK", + 1: "DENIED", + 2: "VERIFICATION_KEY_NOT_FOUND", + } + ConnectResponse_Result_value = map[string]int32{ + "OK": 0, + "DENIED": 1, + "VERIFICATION_KEY_NOT_FOUND": 2, + } +) + +func (x ConnectResponse_Result) Enum() *ConnectResponse_Result { + p := new(ConnectResponse_Result) + *p = x + return p +} + +func (x ConnectResponse_Result) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ConnectResponse_Result) Descriptor() protoreflect.EnumDescriptor { + return file_contact_v1_contact_list_service_proto_enumTypes[4].Descriptor() +} + +func (ConnectResponse_Result) Type() protoreflect.EnumType { + return &file_contact_v1_contact_list_service_proto_enumTypes[4] +} + +func (x ConnectResponse_Result) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ConnectResponse_Result.Descriptor instead. +func (ConnectResponse_Result) EnumDescriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{9, 0} +} + +type CheckSyncRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Auth *v1.Auth `protobuf:"bytes,1,opt,name=auth,proto3" json:"auth,omitempty"` + // XOR-of-SHA256 over the client's current set of normalized E.164 phones. + ClientChecksum []byte `protobuf:"bytes,2,opt,name=client_checksum,json=clientChecksum,proto3" json:"client_checksum,omitempty"` +} + +func (x *CheckSyncRequest) Reset() { + *x = CheckSyncRequest{} + mi := &file_contact_v1_contact_list_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckSyncRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckSyncRequest) ProtoMessage() {} + +func (x *CheckSyncRequest) ProtoReflect() protoreflect.Message { + mi := &file_contact_v1_contact_list_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckSyncRequest.ProtoReflect.Descriptor instead. +func (*CheckSyncRequest) Descriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{0} +} + +func (x *CheckSyncRequest) GetAuth() *v1.Auth { + if x != nil { + return x.Auth + } + return nil +} + +func (x *CheckSyncRequest) GetClientChecksum() []byte { + if x != nil { + return x.ClientChecksum + } + return nil +} + +type CheckSyncResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result CheckSyncResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=flipcash.contact.v1.CheckSyncResponse_Result" json:"result,omitempty"` + // Authoritative server-side checksum. Clients persist this and use it + // as the basis for the next DeltaUpload.old_checksum. + ServerChecksum []byte `protobuf:"bytes,2,opt,name=server_checksum,json=serverChecksum,proto3" json:"server_checksum,omitempty"` +} + +func (x *CheckSyncResponse) Reset() { + *x = CheckSyncResponse{} + mi := &file_contact_v1_contact_list_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckSyncResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckSyncResponse) ProtoMessage() {} + +func (x *CheckSyncResponse) ProtoReflect() protoreflect.Message { + mi := &file_contact_v1_contact_list_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckSyncResponse.ProtoReflect.Descriptor instead. +func (*CheckSyncResponse) Descriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{1} +} + +func (x *CheckSyncResponse) GetResult() CheckSyncResponse_Result { + if x != nil { + return x.Result + } + return CheckSyncResponse_OK +} + +func (x *CheckSyncResponse) GetServerChecksum() []byte { + if x != nil { + return x.ServerChecksum + } + return nil +} + +type DeltaUploadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Auth *v1.Auth `protobuf:"bytes,1,opt,name=auth,proto3" json:"auth,omitempty"` + Adds []*v11.PhoneNumber `protobuf:"bytes,2,rep,name=adds,proto3" json:"adds,omitempty"` + Removes []*v11.PhoneNumber `protobuf:"bytes,3,rep,name=removes,proto3" json:"removes,omitempty"` + // The checksum the client expected the server to have *before* applying + // this delta. Server applies only if stored == old_checksum. + OldChecksum []byte `protobuf:"bytes,4,opt,name=old_checksum,json=oldChecksum,proto3" json:"old_checksum,omitempty"` + // The checksum the client computes for the state *after* applying this + // delta. Server persists this on success. Used to detect retries: if + // stored == new_checksum, the server treats the request as a no-op. + NewChecksum []byte `protobuf:"bytes,5,opt,name=new_checksum,json=newChecksum,proto3" json:"new_checksum,omitempty"` +} + +func (x *DeltaUploadRequest) Reset() { + *x = DeltaUploadRequest{} + mi := &file_contact_v1_contact_list_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeltaUploadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeltaUploadRequest) ProtoMessage() {} + +func (x *DeltaUploadRequest) ProtoReflect() protoreflect.Message { + mi := &file_contact_v1_contact_list_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeltaUploadRequest.ProtoReflect.Descriptor instead. +func (*DeltaUploadRequest) Descriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{2} +} + +func (x *DeltaUploadRequest) GetAuth() *v1.Auth { + if x != nil { + return x.Auth + } + return nil +} + +func (x *DeltaUploadRequest) GetAdds() []*v11.PhoneNumber { + if x != nil { + return x.Adds + } + return nil +} + +func (x *DeltaUploadRequest) GetRemoves() []*v11.PhoneNumber { + if x != nil { + return x.Removes + } + return nil +} + +func (x *DeltaUploadRequest) GetOldChecksum() []byte { + if x != nil { + return x.OldChecksum + } + return nil +} + +func (x *DeltaUploadRequest) GetNewChecksum() []byte { + if x != nil { + return x.NewChecksum + } + return nil +} + +type DeltaUploadResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result DeltaUploadResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=flipcash.contact.v1.DeltaUploadResponse_Result" json:"result,omitempty"` +} + +func (x *DeltaUploadResponse) Reset() { + *x = DeltaUploadResponse{} + mi := &file_contact_v1_contact_list_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeltaUploadResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeltaUploadResponse) ProtoMessage() {} + +func (x *DeltaUploadResponse) ProtoReflect() protoreflect.Message { + mi := &file_contact_v1_contact_list_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeltaUploadResponse.ProtoReflect.Descriptor instead. +func (*DeltaUploadResponse) Descriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{3} +} + +func (x *DeltaUploadResponse) GetResult() DeltaUploadResponse_Result { + if x != nil { + return x.Result + } + return DeltaUploadResponse_OK +} + +type FullUploadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Auth *v1.Auth `protobuf:"bytes,1,opt,name=auth,proto3" json:"auth,omitempty"` + // The complete current contact set. Server replaces stored state with + // this list in one transaction. + Phones []*v11.PhoneNumber `protobuf:"bytes,2,rep,name=phones,proto3" json:"phones,omitempty"` + // XOR-of-SHA256 over the client's current set of normalized E.164 phones. + // Sent on the last streamed request to indicate the end of the upload. + ExpectedChecksum []byte `protobuf:"bytes,3,opt,name=expected_checksum,json=expectedChecksum,proto3" json:"expected_checksum,omitempty"` +} + +func (x *FullUploadRequest) Reset() { + *x = FullUploadRequest{} + mi := &file_contact_v1_contact_list_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FullUploadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FullUploadRequest) ProtoMessage() {} + +func (x *FullUploadRequest) ProtoReflect() protoreflect.Message { + mi := &file_contact_v1_contact_list_service_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FullUploadRequest.ProtoReflect.Descriptor instead. +func (*FullUploadRequest) Descriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{4} +} + +func (x *FullUploadRequest) GetAuth() *v1.Auth { + if x != nil { + return x.Auth + } + return nil +} + +func (x *FullUploadRequest) GetPhones() []*v11.PhoneNumber { + if x != nil { + return x.Phones + } + return nil +} + +func (x *FullUploadRequest) GetExpectedChecksum() []byte { + if x != nil { + return x.ExpectedChecksum + } + return nil +} + +type FullUploadResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result FullUploadResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=flipcash.contact.v1.FullUploadResponse_Result" json:"result,omitempty"` +} + +func (x *FullUploadResponse) Reset() { + *x = FullUploadResponse{} + mi := &file_contact_v1_contact_list_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FullUploadResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FullUploadResponse) ProtoMessage() {} + +func (x *FullUploadResponse) ProtoReflect() protoreflect.Message { + mi := &file_contact_v1_contact_list_service_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FullUploadResponse.ProtoReflect.Descriptor instead. +func (*FullUploadResponse) Descriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{5} +} + +func (x *FullUploadResponse) GetResult() FullUploadResponse_Result { + if x != nil { + return x.Result + } + return FullUploadResponse_OK +} + +type GetFlipcashContactsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Auth *v1.Auth `protobuf:"bytes,1,opt,name=auth,proto3" json:"auth,omitempty"` + Checksum []byte `protobuf:"bytes,2,opt,name=checksum,proto3" json:"checksum,omitempty"` +} + +func (x *GetFlipcashContactsRequest) Reset() { + *x = GetFlipcashContactsRequest{} + mi := &file_contact_v1_contact_list_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFlipcashContactsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFlipcashContactsRequest) ProtoMessage() {} + +func (x *GetFlipcashContactsRequest) ProtoReflect() protoreflect.Message { + mi := &file_contact_v1_contact_list_service_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFlipcashContactsRequest.ProtoReflect.Descriptor instead. +func (*GetFlipcashContactsRequest) Descriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{6} +} + +func (x *GetFlipcashContactsRequest) GetAuth() *v1.Auth { + if x != nil { + return x.Auth + } + return nil +} + +func (x *GetFlipcashContactsRequest) GetChecksum() []byte { + if x != nil { + return x.Checksum + } + return nil +} + +type GetFlipcashContactsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result GetFlipcashContactsResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=flipcash.contact.v1.GetFlipcashContactsResponse_Result" json:"result,omitempty"` + Contacts []*FlipcashContact `protobuf:"bytes,2,rep,name=contacts,proto3" json:"contacts,omitempty"` +} + +func (x *GetFlipcashContactsResponse) Reset() { + *x = GetFlipcashContactsResponse{} + mi := &file_contact_v1_contact_list_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFlipcashContactsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFlipcashContactsResponse) ProtoMessage() {} + +func (x *GetFlipcashContactsResponse) ProtoReflect() protoreflect.Message { + mi := &file_contact_v1_contact_list_service_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFlipcashContactsResponse.ProtoReflect.Descriptor instead. +func (*GetFlipcashContactsResponse) Descriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{7} +} + +func (x *GetFlipcashContactsResponse) GetResult() GetFlipcashContactsResponse_Result { + if x != nil { + return x.Result + } + return GetFlipcashContactsResponse_OK +} + +func (x *GetFlipcashContactsResponse) GetContacts() []*FlipcashContact { + if x != nil { + return x.Contacts + } + return nil +} + +type ConnectRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Auth *v1.Auth `protobuf:"bytes,1,opt,name=auth,proto3" json:"auth,omitempty"` + VerifiedConnection *VerifiedPhoneConnection `protobuf:"bytes,2,opt,name=verified_connection,json=verifiedConnection,proto3" json:"verified_connection,omitempty"` +} + +func (x *ConnectRequest) Reset() { + *x = ConnectRequest{} + mi := &file_contact_v1_contact_list_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConnectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConnectRequest) ProtoMessage() {} + +func (x *ConnectRequest) ProtoReflect() protoreflect.Message { + mi := &file_contact_v1_contact_list_service_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConnectRequest.ProtoReflect.Descriptor instead. +func (*ConnectRequest) Descriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{8} +} + +func (x *ConnectRequest) GetAuth() *v1.Auth { + if x != nil { + return x.Auth + } + return nil +} + +func (x *ConnectRequest) GetVerifiedConnection() *VerifiedPhoneConnection { + if x != nil { + return x.VerifiedConnection + } + return nil +} + +type ConnectResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result ConnectResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=flipcash.contact.v1.ConnectResponse_Result" json:"result,omitempty"` +} + +func (x *ConnectResponse) Reset() { + *x = ConnectResponse{} + mi := &file_contact_v1_contact_list_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConnectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConnectResponse) ProtoMessage() {} + +func (x *ConnectResponse) ProtoReflect() protoreflect.Message { + mi := &file_contact_v1_contact_list_service_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConnectResponse.ProtoReflect.Descriptor instead. +func (*ConnectResponse) Descriptor() ([]byte, []int) { + return file_contact_v1_contact_list_service_proto_rawDescGZIP(), []int{9} +} + +func (x *ConnectResponse) GetResult() ConnectResponse_Result { + if x != nil { + return x.Result + } + return ConnectResponse_OK +} + +var File_contact_v1_contact_list_service_proto protoreflect.FileDescriptor + +var file_contact_v1_contact_list_service_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x63, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, + 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x16, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x70, 0x68, + 0x6f, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7c, 0x0a, 0x10, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x36, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, + 0x01, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x12, 0x30, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x7a, 0x02, 0x68, 0x20, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, 0xaf, 0x01, 0x0a, 0x11, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x45, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x2d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x79, 0x6e, 0x63, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x30, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x07, 0xfa, 0x42, 0x04, 0x7a, 0x02, 0x68, 0x20, 0x52, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, 0x21, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x55, + 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x01, 0x22, 0xa8, 0x02, 0x0a, 0x12, + 0x44, 0x65, 0x6c, 0x74, 0x61, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x36, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, + 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x12, 0x3d, 0x0a, 0x04, 0x61, 0x64, + 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, + 0x61, 0x73, 0x68, 0x2e, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x68, 0x6f, + 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x92, 0x01, 0x03, + 0x10, 0xe8, 0x07, 0x52, 0x04, 0x61, 0x64, 0x64, 0x73, 0x12, 0x43, 0x0a, 0x07, 0x72, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x66, 0x6c, 0x69, + 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x92, + 0x01, 0x03, 0x10, 0xe8, 0x07, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x73, 0x12, 0x2a, + 0x0a, 0x0c, 0x6f, 0x6c, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x7a, 0x02, 0x68, 0x20, 0x52, 0x0b, 0x6f, + 0x6c, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x2a, 0x0a, 0x0c, 0x6e, 0x65, + 0x77, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x7a, 0x02, 0x68, 0x20, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, 0x84, 0x01, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x74, 0x61, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, + 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, + 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x24, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x48, 0x45, + 0x43, 0x4b, 0x53, 0x55, 0x4d, 0x5f, 0x44, 0x52, 0x49, 0x46, 0x54, 0x10, 0x01, 0x22, 0xbb, 0x01, + 0x0a, 0x11, 0x46, 0x75, 0x6c, 0x6c, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x42, 0x08, 0xfa, 0x42, 0x05, + 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x12, 0x41, 0x0a, 0x06, 0x70, + 0x68, 0x6f, 0x6e, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x09, 0xfa, 0x42, 0x06, + 0x92, 0x01, 0x03, 0x10, 0xe8, 0x07, 0x52, 0x06, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x73, 0x12, 0x2b, + 0x0a, 0x11, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x73, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x65, 0x78, 0x70, 0x65, 0x63, + 0x74, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, 0x85, 0x01, 0x0a, 0x12, + 0x46, 0x75, 0x6c, 0x6c, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x46, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x75, 0x6c, 0x6c, 0x55, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x27, 0x0a, 0x06, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, + 0x43, 0x48, 0x45, 0x43, 0x4b, 0x53, 0x55, 0x4d, 0x5f, 0x4d, 0x49, 0x53, 0x4d, 0x41, 0x54, 0x43, + 0x48, 0x10, 0x01, 0x22, 0x79, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x69, 0x70, 0x63, 0x61, + 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x36, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, + 0x02, 0x10, 0x01, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x12, 0x23, 0x0a, 0x08, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0xfa, 0x42, 0x04, + 0x7a, 0x02, 0x68, 0x20, 0x52, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, 0xf0, + 0x01, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, + 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x37, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, + 0x4b, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x92, 0x01, 0x03, 0x10, + 0xe8, 0x07, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x73, 0x22, 0x33, 0x0a, 0x06, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x12, + 0x0a, 0x0e, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x53, 0x55, 0x4d, 0x5f, 0x44, 0x52, 0x49, 0x46, 0x54, + 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, + 0x02, 0x22, 0xb1, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x42, 0x08, 0xfa, 0x42, + 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x12, 0x67, 0x0a, 0x13, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, + 0x01, 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x94, 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3c, + 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, + 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1e, 0x0a, 0x1a, + 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4b, 0x45, 0x59, + 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x02, 0x32, 0xfe, 0x03, 0x0a, + 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x5a, 0x0a, 0x09, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x25, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x26, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x79, 0x6e, 0x63, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x74, + 0x61, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, + 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, + 0x6c, 0x74, 0x61, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x55, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x0a, 0x46, 0x75, + 0x6c, 0x6c, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x26, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, + 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x46, + 0x75, 0x6c, 0x6c, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x75, 0x6c, 0x6c, 0x55, 0x70, 0x6c, 0x6f, 0x61, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x7a, 0x0a, 0x13, 0x47, + 0x65, 0x74, 0x46, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, + 0x74, 0x73, 0x12, 0x2f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x69, 0x70, + 0x63, 0x61, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x69, + 0x70, 0x63, 0x61, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x54, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, + 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x53, 0x5a, + 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, + 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, + 0x73, 0x68, 0x32, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x70, 0x69, + 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_contact_v1_contact_list_service_proto_rawDescOnce sync.Once + file_contact_v1_contact_list_service_proto_rawDescData = file_contact_v1_contact_list_service_proto_rawDesc +) + +func file_contact_v1_contact_list_service_proto_rawDescGZIP() []byte { + file_contact_v1_contact_list_service_proto_rawDescOnce.Do(func() { + file_contact_v1_contact_list_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_contact_v1_contact_list_service_proto_rawDescData) + }) + return file_contact_v1_contact_list_service_proto_rawDescData +} + +var file_contact_v1_contact_list_service_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_contact_v1_contact_list_service_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_contact_v1_contact_list_service_proto_goTypes = []any{ + (CheckSyncResponse_Result)(0), // 0: flipcash.contact.v1.CheckSyncResponse.Result + (DeltaUploadResponse_Result)(0), // 1: flipcash.contact.v1.DeltaUploadResponse.Result + (FullUploadResponse_Result)(0), // 2: flipcash.contact.v1.FullUploadResponse.Result + (GetFlipcashContactsResponse_Result)(0), // 3: flipcash.contact.v1.GetFlipcashContactsResponse.Result + (ConnectResponse_Result)(0), // 4: flipcash.contact.v1.ConnectResponse.Result + (*CheckSyncRequest)(nil), // 5: flipcash.contact.v1.CheckSyncRequest + (*CheckSyncResponse)(nil), // 6: flipcash.contact.v1.CheckSyncResponse + (*DeltaUploadRequest)(nil), // 7: flipcash.contact.v1.DeltaUploadRequest + (*DeltaUploadResponse)(nil), // 8: flipcash.contact.v1.DeltaUploadResponse + (*FullUploadRequest)(nil), // 9: flipcash.contact.v1.FullUploadRequest + (*FullUploadResponse)(nil), // 10: flipcash.contact.v1.FullUploadResponse + (*GetFlipcashContactsRequest)(nil), // 11: flipcash.contact.v1.GetFlipcashContactsRequest + (*GetFlipcashContactsResponse)(nil), // 12: flipcash.contact.v1.GetFlipcashContactsResponse + (*ConnectRequest)(nil), // 13: flipcash.contact.v1.ConnectRequest + (*ConnectResponse)(nil), // 14: flipcash.contact.v1.ConnectResponse + (*v1.Auth)(nil), // 15: flipcash.common.v1.Auth + (*v11.PhoneNumber)(nil), // 16: flipcash.phone.v1.PhoneNumber + (*FlipcashContact)(nil), // 17: flipcash.contact.v1.FlipcashContact + (*VerifiedPhoneConnection)(nil), // 18: flipcash.contact.v1.VerifiedPhoneConnection +} +var file_contact_v1_contact_list_service_proto_depIdxs = []int32{ + 15, // 0: flipcash.contact.v1.CheckSyncRequest.auth:type_name -> flipcash.common.v1.Auth + 0, // 1: flipcash.contact.v1.CheckSyncResponse.result:type_name -> flipcash.contact.v1.CheckSyncResponse.Result + 15, // 2: flipcash.contact.v1.DeltaUploadRequest.auth:type_name -> flipcash.common.v1.Auth + 16, // 3: flipcash.contact.v1.DeltaUploadRequest.adds:type_name -> flipcash.phone.v1.PhoneNumber + 16, // 4: flipcash.contact.v1.DeltaUploadRequest.removes:type_name -> flipcash.phone.v1.PhoneNumber + 1, // 5: flipcash.contact.v1.DeltaUploadResponse.result:type_name -> flipcash.contact.v1.DeltaUploadResponse.Result + 15, // 6: flipcash.contact.v1.FullUploadRequest.auth:type_name -> flipcash.common.v1.Auth + 16, // 7: flipcash.contact.v1.FullUploadRequest.phones:type_name -> flipcash.phone.v1.PhoneNumber + 2, // 8: flipcash.contact.v1.FullUploadResponse.result:type_name -> flipcash.contact.v1.FullUploadResponse.Result + 15, // 9: flipcash.contact.v1.GetFlipcashContactsRequest.auth:type_name -> flipcash.common.v1.Auth + 3, // 10: flipcash.contact.v1.GetFlipcashContactsResponse.result:type_name -> flipcash.contact.v1.GetFlipcashContactsResponse.Result + 17, // 11: flipcash.contact.v1.GetFlipcashContactsResponse.contacts:type_name -> flipcash.contact.v1.FlipcashContact + 15, // 12: flipcash.contact.v1.ConnectRequest.auth:type_name -> flipcash.common.v1.Auth + 18, // 13: flipcash.contact.v1.ConnectRequest.verified_connection:type_name -> flipcash.contact.v1.VerifiedPhoneConnection + 4, // 14: flipcash.contact.v1.ConnectResponse.result:type_name -> flipcash.contact.v1.ConnectResponse.Result + 5, // 15: flipcash.contact.v1.ContactList.CheckSync:input_type -> flipcash.contact.v1.CheckSyncRequest + 7, // 16: flipcash.contact.v1.ContactList.DeltaUpload:input_type -> flipcash.contact.v1.DeltaUploadRequest + 9, // 17: flipcash.contact.v1.ContactList.FullUpload:input_type -> flipcash.contact.v1.FullUploadRequest + 11, // 18: flipcash.contact.v1.ContactList.GetFlipcashContacts:input_type -> flipcash.contact.v1.GetFlipcashContactsRequest + 13, // 19: flipcash.contact.v1.ContactList.Connect:input_type -> flipcash.contact.v1.ConnectRequest + 6, // 20: flipcash.contact.v1.ContactList.CheckSync:output_type -> flipcash.contact.v1.CheckSyncResponse + 8, // 21: flipcash.contact.v1.ContactList.DeltaUpload:output_type -> flipcash.contact.v1.DeltaUploadResponse + 10, // 22: flipcash.contact.v1.ContactList.FullUpload:output_type -> flipcash.contact.v1.FullUploadResponse + 12, // 23: flipcash.contact.v1.ContactList.GetFlipcashContacts:output_type -> flipcash.contact.v1.GetFlipcashContactsResponse + 14, // 24: flipcash.contact.v1.ContactList.Connect:output_type -> flipcash.contact.v1.ConnectResponse + 20, // [20:25] is the sub-list for method output_type + 15, // [15:20] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name +} + +func init() { file_contact_v1_contact_list_service_proto_init() } +func file_contact_v1_contact_list_service_proto_init() { + if File_contact_v1_contact_list_service_proto != nil { + return + } + file_contact_v1_model_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_contact_v1_contact_list_service_proto_rawDesc, + NumEnums: 5, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_contact_v1_contact_list_service_proto_goTypes, + DependencyIndexes: file_contact_v1_contact_list_service_proto_depIdxs, + EnumInfos: file_contact_v1_contact_list_service_proto_enumTypes, + MessageInfos: file_contact_v1_contact_list_service_proto_msgTypes, + }.Build() + File_contact_v1_contact_list_service_proto = out.File + file_contact_v1_contact_list_service_proto_rawDesc = nil + file_contact_v1_contact_list_service_proto_goTypes = nil + file_contact_v1_contact_list_service_proto_depIdxs = nil +} diff --git a/generated/go/contact/v1/contact_list_service.pb.validate.go b/generated/go/contact/v1/contact_list_service.pb.validate.go new file mode 100644 index 0000000..64ee8bf --- /dev/null +++ b/generated/go/contact/v1/contact_list_service.pb.validate.go @@ -0,0 +1,1538 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: contact/v1/contact_list_service.proto + +package contactpb + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on CheckSyncRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *CheckSyncRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CheckSyncRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CheckSyncRequestMultiError, or nil if none found. +func (m *CheckSyncRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *CheckSyncRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetAuth() == nil { + err := CheckSyncRequestValidationError{ + field: "Auth", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetAuth()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CheckSyncRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CheckSyncRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAuth()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CheckSyncRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(m.GetClientChecksum()) != 32 { + err := CheckSyncRequestValidationError{ + field: "ClientChecksum", + reason: "value length must be 32 bytes", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return CheckSyncRequestMultiError(errors) + } + + return nil +} + +// CheckSyncRequestMultiError is an error wrapping multiple validation errors +// returned by CheckSyncRequest.ValidateAll() if the designated constraints +// aren't met. +type CheckSyncRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CheckSyncRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CheckSyncRequestMultiError) AllErrors() []error { return m } + +// CheckSyncRequestValidationError is the validation error returned by +// CheckSyncRequest.Validate if the designated constraints aren't met. +type CheckSyncRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CheckSyncRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CheckSyncRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CheckSyncRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CheckSyncRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CheckSyncRequestValidationError) ErrorName() string { return "CheckSyncRequestValidationError" } + +// Error satisfies the builtin error interface +func (e CheckSyncRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCheckSyncRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CheckSyncRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CheckSyncRequestValidationError{} + +// Validate checks the field values on CheckSyncResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *CheckSyncResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CheckSyncResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CheckSyncResponseMultiError, or nil if none found. +func (m *CheckSyncResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *CheckSyncResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Result + + if len(m.GetServerChecksum()) != 32 { + err := CheckSyncResponseValidationError{ + field: "ServerChecksum", + reason: "value length must be 32 bytes", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return CheckSyncResponseMultiError(errors) + } + + return nil +} + +// CheckSyncResponseMultiError is an error wrapping multiple validation errors +// returned by CheckSyncResponse.ValidateAll() if the designated constraints +// aren't met. +type CheckSyncResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CheckSyncResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CheckSyncResponseMultiError) AllErrors() []error { return m } + +// CheckSyncResponseValidationError is the validation error returned by +// CheckSyncResponse.Validate if the designated constraints aren't met. +type CheckSyncResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CheckSyncResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CheckSyncResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CheckSyncResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CheckSyncResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CheckSyncResponseValidationError) ErrorName() string { + return "CheckSyncResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e CheckSyncResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCheckSyncResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CheckSyncResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CheckSyncResponseValidationError{} + +// Validate checks the field values on DeltaUploadRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *DeltaUploadRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeltaUploadRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeltaUploadRequestMultiError, or nil if none found. +func (m *DeltaUploadRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeltaUploadRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetAuth() == nil { + err := DeltaUploadRequestValidationError{ + field: "Auth", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetAuth()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DeltaUploadRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DeltaUploadRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAuth()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DeltaUploadRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(m.GetAdds()) > 1000 { + err := DeltaUploadRequestValidationError{ + field: "Adds", + reason: "value must contain no more than 1000 item(s)", + } + if !all { + return err + } + errors = append(errors, err) + } + + for idx, item := range m.GetAdds() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DeltaUploadRequestValidationError{ + field: fmt.Sprintf("Adds[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DeltaUploadRequestValidationError{ + field: fmt.Sprintf("Adds[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DeltaUploadRequestValidationError{ + field: fmt.Sprintf("Adds[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(m.GetRemoves()) > 1000 { + err := DeltaUploadRequestValidationError{ + field: "Removes", + reason: "value must contain no more than 1000 item(s)", + } + if !all { + return err + } + errors = append(errors, err) + } + + for idx, item := range m.GetRemoves() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DeltaUploadRequestValidationError{ + field: fmt.Sprintf("Removes[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DeltaUploadRequestValidationError{ + field: fmt.Sprintf("Removes[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DeltaUploadRequestValidationError{ + field: fmt.Sprintf("Removes[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(m.GetOldChecksum()) != 32 { + err := DeltaUploadRequestValidationError{ + field: "OldChecksum", + reason: "value length must be 32 bytes", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(m.GetNewChecksum()) != 32 { + err := DeltaUploadRequestValidationError{ + field: "NewChecksum", + reason: "value length must be 32 bytes", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return DeltaUploadRequestMultiError(errors) + } + + return nil +} + +// DeltaUploadRequestMultiError is an error wrapping multiple validation errors +// returned by DeltaUploadRequest.ValidateAll() if the designated constraints +// aren't met. +type DeltaUploadRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeltaUploadRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeltaUploadRequestMultiError) AllErrors() []error { return m } + +// DeltaUploadRequestValidationError is the validation error returned by +// DeltaUploadRequest.Validate if the designated constraints aren't met. +type DeltaUploadRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeltaUploadRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeltaUploadRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeltaUploadRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeltaUploadRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeltaUploadRequestValidationError) ErrorName() string { + return "DeltaUploadRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeltaUploadRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeltaUploadRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeltaUploadRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeltaUploadRequestValidationError{} + +// Validate checks the field values on DeltaUploadResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *DeltaUploadResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeltaUploadResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeltaUploadResponseMultiError, or nil if none found. +func (m *DeltaUploadResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *DeltaUploadResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Result + + if len(errors) > 0 { + return DeltaUploadResponseMultiError(errors) + } + + return nil +} + +// DeltaUploadResponseMultiError is an error wrapping multiple validation +// errors returned by DeltaUploadResponse.ValidateAll() if the designated +// constraints aren't met. +type DeltaUploadResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeltaUploadResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeltaUploadResponseMultiError) AllErrors() []error { return m } + +// DeltaUploadResponseValidationError is the validation error returned by +// DeltaUploadResponse.Validate if the designated constraints aren't met. +type DeltaUploadResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeltaUploadResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeltaUploadResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeltaUploadResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeltaUploadResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeltaUploadResponseValidationError) ErrorName() string { + return "DeltaUploadResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e DeltaUploadResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeltaUploadResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeltaUploadResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeltaUploadResponseValidationError{} + +// Validate checks the field values on FullUploadRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *FullUploadRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on FullUploadRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// FullUploadRequestMultiError, or nil if none found. +func (m *FullUploadRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *FullUploadRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetAuth() == nil { + err := FullUploadRequestValidationError{ + field: "Auth", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetAuth()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, FullUploadRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, FullUploadRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAuth()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FullUploadRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(m.GetPhones()) > 1000 { + err := FullUploadRequestValidationError{ + field: "Phones", + reason: "value must contain no more than 1000 item(s)", + } + if !all { + return err + } + errors = append(errors, err) + } + + for idx, item := range m.GetPhones() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, FullUploadRequestValidationError{ + field: fmt.Sprintf("Phones[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, FullUploadRequestValidationError{ + field: fmt.Sprintf("Phones[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FullUploadRequestValidationError{ + field: fmt.Sprintf("Phones[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for ExpectedChecksum + + if len(errors) > 0 { + return FullUploadRequestMultiError(errors) + } + + return nil +} + +// FullUploadRequestMultiError is an error wrapping multiple validation errors +// returned by FullUploadRequest.ValidateAll() if the designated constraints +// aren't met. +type FullUploadRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m FullUploadRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m FullUploadRequestMultiError) AllErrors() []error { return m } + +// FullUploadRequestValidationError is the validation error returned by +// FullUploadRequest.Validate if the designated constraints aren't met. +type FullUploadRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e FullUploadRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e FullUploadRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e FullUploadRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e FullUploadRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e FullUploadRequestValidationError) ErrorName() string { + return "FullUploadRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e FullUploadRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sFullUploadRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = FullUploadRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = FullUploadRequestValidationError{} + +// Validate checks the field values on FullUploadResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *FullUploadResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on FullUploadResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// FullUploadResponseMultiError, or nil if none found. +func (m *FullUploadResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *FullUploadResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Result + + if len(errors) > 0 { + return FullUploadResponseMultiError(errors) + } + + return nil +} + +// FullUploadResponseMultiError is an error wrapping multiple validation errors +// returned by FullUploadResponse.ValidateAll() if the designated constraints +// aren't met. +type FullUploadResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m FullUploadResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m FullUploadResponseMultiError) AllErrors() []error { return m } + +// FullUploadResponseValidationError is the validation error returned by +// FullUploadResponse.Validate if the designated constraints aren't met. +type FullUploadResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e FullUploadResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e FullUploadResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e FullUploadResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e FullUploadResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e FullUploadResponseValidationError) ErrorName() string { + return "FullUploadResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e FullUploadResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sFullUploadResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = FullUploadResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = FullUploadResponseValidationError{} + +// Validate checks the field values on GetFlipcashContactsRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetFlipcashContactsRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetFlipcashContactsRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetFlipcashContactsRequestMultiError, or nil if none found. +func (m *GetFlipcashContactsRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetFlipcashContactsRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetAuth() == nil { + err := GetFlipcashContactsRequestValidationError{ + field: "Auth", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetAuth()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetFlipcashContactsRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetFlipcashContactsRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAuth()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetFlipcashContactsRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(m.GetChecksum()) != 32 { + err := GetFlipcashContactsRequestValidationError{ + field: "Checksum", + reason: "value length must be 32 bytes", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return GetFlipcashContactsRequestMultiError(errors) + } + + return nil +} + +// GetFlipcashContactsRequestMultiError is an error wrapping multiple +// validation errors returned by GetFlipcashContactsRequest.ValidateAll() if +// the designated constraints aren't met. +type GetFlipcashContactsRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetFlipcashContactsRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetFlipcashContactsRequestMultiError) AllErrors() []error { return m } + +// GetFlipcashContactsRequestValidationError is the validation error returned +// by GetFlipcashContactsRequest.Validate if the designated constraints aren't met. +type GetFlipcashContactsRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetFlipcashContactsRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetFlipcashContactsRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetFlipcashContactsRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetFlipcashContactsRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetFlipcashContactsRequestValidationError) ErrorName() string { + return "GetFlipcashContactsRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetFlipcashContactsRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetFlipcashContactsRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetFlipcashContactsRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetFlipcashContactsRequestValidationError{} + +// Validate checks the field values on GetFlipcashContactsResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetFlipcashContactsResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetFlipcashContactsResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetFlipcashContactsResponseMultiError, or nil if none found. +func (m *GetFlipcashContactsResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetFlipcashContactsResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Result + + if len(m.GetContacts()) > 1000 { + err := GetFlipcashContactsResponseValidationError{ + field: "Contacts", + reason: "value must contain no more than 1000 item(s)", + } + if !all { + return err + } + errors = append(errors, err) + } + + for idx, item := range m.GetContacts() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetFlipcashContactsResponseValidationError{ + field: fmt.Sprintf("Contacts[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetFlipcashContactsResponseValidationError{ + field: fmt.Sprintf("Contacts[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetFlipcashContactsResponseValidationError{ + field: fmt.Sprintf("Contacts[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return GetFlipcashContactsResponseMultiError(errors) + } + + return nil +} + +// GetFlipcashContactsResponseMultiError is an error wrapping multiple +// validation errors returned by GetFlipcashContactsResponse.ValidateAll() if +// the designated constraints aren't met. +type GetFlipcashContactsResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetFlipcashContactsResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetFlipcashContactsResponseMultiError) AllErrors() []error { return m } + +// GetFlipcashContactsResponseValidationError is the validation error returned +// by GetFlipcashContactsResponse.Validate if the designated constraints +// aren't met. +type GetFlipcashContactsResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetFlipcashContactsResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetFlipcashContactsResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetFlipcashContactsResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetFlipcashContactsResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetFlipcashContactsResponseValidationError) ErrorName() string { + return "GetFlipcashContactsResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetFlipcashContactsResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetFlipcashContactsResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetFlipcashContactsResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetFlipcashContactsResponseValidationError{} + +// Validate checks the field values on ConnectRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *ConnectRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ConnectRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in ConnectRequestMultiError, +// or nil if none found. +func (m *ConnectRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *ConnectRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetAuth() == nil { + err := ConnectRequestValidationError{ + field: "Auth", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetAuth()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ConnectRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ConnectRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAuth()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConnectRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.GetVerifiedConnection() == nil { + err := ConnectRequestValidationError{ + field: "VerifiedConnection", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetVerifiedConnection()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ConnectRequestValidationError{ + field: "VerifiedConnection", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ConnectRequestValidationError{ + field: "VerifiedConnection", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetVerifiedConnection()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConnectRequestValidationError{ + field: "VerifiedConnection", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return ConnectRequestMultiError(errors) + } + + return nil +} + +// ConnectRequestMultiError is an error wrapping multiple validation errors +// returned by ConnectRequest.ValidateAll() if the designated constraints +// aren't met. +type ConnectRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ConnectRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ConnectRequestMultiError) AllErrors() []error { return m } + +// ConnectRequestValidationError is the validation error returned by +// ConnectRequest.Validate if the designated constraints aren't met. +type ConnectRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConnectRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConnectRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConnectRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConnectRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConnectRequestValidationError) ErrorName() string { return "ConnectRequestValidationError" } + +// Error satisfies the builtin error interface +func (e ConnectRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConnectRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConnectRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConnectRequestValidationError{} + +// Validate checks the field values on ConnectResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *ConnectResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ConnectResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ConnectResponseMultiError, or nil if none found. +func (m *ConnectResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ConnectResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Result + + if len(errors) > 0 { + return ConnectResponseMultiError(errors) + } + + return nil +} + +// ConnectResponseMultiError is an error wrapping multiple validation errors +// returned by ConnectResponse.ValidateAll() if the designated constraints +// aren't met. +type ConnectResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ConnectResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ConnectResponseMultiError) AllErrors() []error { return m } + +// ConnectResponseValidationError is the validation error returned by +// ConnectResponse.Validate if the designated constraints aren't met. +type ConnectResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConnectResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConnectResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConnectResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConnectResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConnectResponseValidationError) ErrorName() string { return "ConnectResponseValidationError" } + +// Error satisfies the builtin error interface +func (e ConnectResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConnectResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConnectResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConnectResponseValidationError{} diff --git a/generated/go/contact/v1/contact_list_service_grpc.pb.go b/generated/go/contact/v1/contact_list_service_grpc.pb.go new file mode 100644 index 0000000..0b01ed2 --- /dev/null +++ b/generated/go/contact/v1/contact_list_service_grpc.pb.go @@ -0,0 +1,318 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.21.12 +// source: contact/v1/contact_list_service.proto + +package contactpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + ContactList_CheckSync_FullMethodName = "/flipcash.contact.v1.ContactList/CheckSync" + ContactList_DeltaUpload_FullMethodName = "/flipcash.contact.v1.ContactList/DeltaUpload" + ContactList_FullUpload_FullMethodName = "/flipcash.contact.v1.ContactList/FullUpload" + ContactList_GetFlipcashContacts_FullMethodName = "/flipcash.contact.v1.ContactList/GetFlipcashContacts" + ContactList_Connect_FullMethodName = "/flipcash.contact.v1.ContactList/Connect" +) + +// ContactListClient is the client API for ContactList service. +// +// 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. +// +// ContactList manages a user's contact list and surfaces which contacts are +// Flipcash users. +// +// Sync model: +// - The client maintains a 32-byte XOR-of-SHA256 checksum over its current +// contact set, and an OS-specific cursor for incremental change discovery. +// The cursor is local-only and never leaves the device. +// - Steady state: client computes a delta from the OS cursor, sends it via +// DeltaUpload with old/new checksums for compare-and-swap. +// - Recovery: on first install, after OS history truncation, or after +// CHECKSUM_DRIFT, the client uses FullUpload to replace the server's state +// wholesale. +type ContactListClient interface { + // CheckSync compares the client's checksum to the server's. Cheap, used + // on app foreground to decide whether any upload is needed. + CheckSync(ctx context.Context, in *CheckSyncRequest, opts ...grpc.CallOption) (*CheckSyncResponse, error) + // DeltaUpload applies a delta under compare-and-swap on the checksum. + // Safe to retry indefinitely with the same payload. + DeltaUpload(ctx context.Context, in *DeltaUploadRequest, opts ...grpc.CallOption) (*DeltaUploadResponse, error) + // FullUpload replaces the user's contact set entirely. Used when + // a delta cannot be constructed or CHECKSUM_DRIFT was returned. + FullUpload(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[FullUploadRequest, FullUploadResponse], error) + // GetFlipcashContacts gets the set of contacts that are on Flipcash + GetFlipcashContacts(ctx context.Context, in *GetFlipcashContactsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetFlipcashContactsResponse], error) + // Connect connects a contact for payment using a verifiable proto messaged + // signed with an out-of-band verification key. Both contacts must connect + // with the same verification key to enable payments. The verification key + // must be stored in secure storage prior to calling this RPC. + Connect(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (*ConnectResponse, error) +} + +type contactListClient struct { + cc grpc.ClientConnInterface +} + +func NewContactListClient(cc grpc.ClientConnInterface) ContactListClient { + return &contactListClient{cc} +} + +func (c *contactListClient) CheckSync(ctx context.Context, in *CheckSyncRequest, opts ...grpc.CallOption) (*CheckSyncResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CheckSyncResponse) + err := c.cc.Invoke(ctx, ContactList_CheckSync_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *contactListClient) DeltaUpload(ctx context.Context, in *DeltaUploadRequest, opts ...grpc.CallOption) (*DeltaUploadResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeltaUploadResponse) + err := c.cc.Invoke(ctx, ContactList_DeltaUpload_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *contactListClient) FullUpload(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[FullUploadRequest, FullUploadResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ContactList_ServiceDesc.Streams[0], ContactList_FullUpload_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[FullUploadRequest, FullUploadResponse]{ClientStream: stream} + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ContactList_FullUploadClient = grpc.ClientStreamingClient[FullUploadRequest, FullUploadResponse] + +func (c *contactListClient) GetFlipcashContacts(ctx context.Context, in *GetFlipcashContactsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetFlipcashContactsResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ContactList_ServiceDesc.Streams[1], ContactList_GetFlipcashContacts_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[GetFlipcashContactsRequest, GetFlipcashContactsResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ContactList_GetFlipcashContactsClient = grpc.ServerStreamingClient[GetFlipcashContactsResponse] + +func (c *contactListClient) Connect(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (*ConnectResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ConnectResponse) + err := c.cc.Invoke(ctx, ContactList_Connect_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ContactListServer is the server API for ContactList service. +// All implementations must embed UnimplementedContactListServer +// for forward compatibility. +// +// ContactList manages a user's contact list and surfaces which contacts are +// Flipcash users. +// +// Sync model: +// - The client maintains a 32-byte XOR-of-SHA256 checksum over its current +// contact set, and an OS-specific cursor for incremental change discovery. +// The cursor is local-only and never leaves the device. +// - Steady state: client computes a delta from the OS cursor, sends it via +// DeltaUpload with old/new checksums for compare-and-swap. +// - Recovery: on first install, after OS history truncation, or after +// CHECKSUM_DRIFT, the client uses FullUpload to replace the server's state +// wholesale. +type ContactListServer interface { + // CheckSync compares the client's checksum to the server's. Cheap, used + // on app foreground to decide whether any upload is needed. + CheckSync(context.Context, *CheckSyncRequest) (*CheckSyncResponse, error) + // DeltaUpload applies a delta under compare-and-swap on the checksum. + // Safe to retry indefinitely with the same payload. + DeltaUpload(context.Context, *DeltaUploadRequest) (*DeltaUploadResponse, error) + // FullUpload replaces the user's contact set entirely. Used when + // a delta cannot be constructed or CHECKSUM_DRIFT was returned. + FullUpload(grpc.ClientStreamingServer[FullUploadRequest, FullUploadResponse]) error + // GetFlipcashContacts gets the set of contacts that are on Flipcash + GetFlipcashContacts(*GetFlipcashContactsRequest, grpc.ServerStreamingServer[GetFlipcashContactsResponse]) error + // Connect connects a contact for payment using a verifiable proto messaged + // signed with an out-of-band verification key. Both contacts must connect + // with the same verification key to enable payments. The verification key + // must be stored in secure storage prior to calling this RPC. + Connect(context.Context, *ConnectRequest) (*ConnectResponse, error) + mustEmbedUnimplementedContactListServer() +} + +// UnimplementedContactListServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedContactListServer struct{} + +func (UnimplementedContactListServer) CheckSync(context.Context, *CheckSyncRequest) (*CheckSyncResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckSync not implemented") +} +func (UnimplementedContactListServer) DeltaUpload(context.Context, *DeltaUploadRequest) (*DeltaUploadResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeltaUpload not implemented") +} +func (UnimplementedContactListServer) FullUpload(grpc.ClientStreamingServer[FullUploadRequest, FullUploadResponse]) error { + return status.Errorf(codes.Unimplemented, "method FullUpload not implemented") +} +func (UnimplementedContactListServer) GetFlipcashContacts(*GetFlipcashContactsRequest, grpc.ServerStreamingServer[GetFlipcashContactsResponse]) error { + return status.Errorf(codes.Unimplemented, "method GetFlipcashContacts not implemented") +} +func (UnimplementedContactListServer) Connect(context.Context, *ConnectRequest) (*ConnectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Connect not implemented") +} +func (UnimplementedContactListServer) mustEmbedUnimplementedContactListServer() {} +func (UnimplementedContactListServer) testEmbeddedByValue() {} + +// UnsafeContactListServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ContactListServer will +// result in compilation errors. +type UnsafeContactListServer interface { + mustEmbedUnimplementedContactListServer() +} + +func RegisterContactListServer(s grpc.ServiceRegistrar, srv ContactListServer) { + // If the following call pancis, it indicates UnimplementedContactListServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&ContactList_ServiceDesc, srv) +} + +func _ContactList_CheckSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CheckSyncRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContactListServer).CheckSync(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ContactList_CheckSync_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContactListServer).CheckSync(ctx, req.(*CheckSyncRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContactList_DeltaUpload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeltaUploadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContactListServer).DeltaUpload(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ContactList_DeltaUpload_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContactListServer).DeltaUpload(ctx, req.(*DeltaUploadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContactList_FullUpload_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ContactListServer).FullUpload(&grpc.GenericServerStream[FullUploadRequest, FullUploadResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ContactList_FullUploadServer = grpc.ClientStreamingServer[FullUploadRequest, FullUploadResponse] + +func _ContactList_GetFlipcashContacts_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetFlipcashContactsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ContactListServer).GetFlipcashContacts(m, &grpc.GenericServerStream[GetFlipcashContactsRequest, GetFlipcashContactsResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ContactList_GetFlipcashContactsServer = grpc.ServerStreamingServer[GetFlipcashContactsResponse] + +func _ContactList_Connect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ConnectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContactListServer).Connect(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ContactList_Connect_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContactListServer).Connect(ctx, req.(*ConnectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ContactList_ServiceDesc is the grpc.ServiceDesc for ContactList service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ContactList_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "flipcash.contact.v1.ContactList", + HandlerType: (*ContactListServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CheckSync", + Handler: _ContactList_CheckSync_Handler, + }, + { + MethodName: "DeltaUpload", + Handler: _ContactList_DeltaUpload_Handler, + }, + { + MethodName: "Connect", + Handler: _ContactList_Connect_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "FullUpload", + Handler: _ContactList_FullUpload_Handler, + ClientStreams: true, + }, + { + StreamName: "GetFlipcashContacts", + Handler: _ContactList_GetFlipcashContacts_Handler, + ServerStreams: true, + }, + }, + Metadata: "contact/v1/contact_list_service.proto", +} diff --git a/generated/go/contact/v1/model.pb.go b/generated/go/contact/v1/model.pb.go new file mode 100644 index 0000000..78f3f2e --- /dev/null +++ b/generated/go/contact/v1/model.pb.go @@ -0,0 +1,240 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.21.12 +// source: contact/v1/model.proto + +package contactpb + +import ( + v11 "github.com/code-payments/flipcash2-protobuf-api/generated/go/common/v1" + v1 "github.com/code-payments/flipcash2-protobuf-api/generated/go/phone/v1" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type FlipcashContact struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Phone *v1.PhoneNumber `protobuf:"bytes,1,opt,name=phone,proto3" json:"phone,omitempty"` + // Is this contact connected for payment? + IsConnectedForPayment bool `protobuf:"varint,2,opt,name=is_connected_for_payment,json=isConnectedForPayment,proto3" json:"is_connected_for_payment,omitempty"` +} + +func (x *FlipcashContact) Reset() { + *x = FlipcashContact{} + mi := &file_contact_v1_model_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlipcashContact) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlipcashContact) ProtoMessage() {} + +func (x *FlipcashContact) ProtoReflect() protoreflect.Message { + mi := &file_contact_v1_model_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlipcashContact.ProtoReflect.Descriptor instead. +func (*FlipcashContact) Descriptor() ([]byte, []int) { + return file_contact_v1_model_proto_rawDescGZIP(), []int{0} +} + +func (x *FlipcashContact) GetPhone() *v1.PhoneNumber { + if x != nil { + return x.Phone + } + return nil +} + +func (x *FlipcashContact) GetIsConnectedForPayment() bool { + if x != nil { + return x.IsConnectedForPayment + } + return false +} + +type VerifiedPhoneConnection struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PhoneNumber *v1.PhoneNumber `protobuf:"bytes,1,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` + PaymentDestination *v11.PublicKey `protobuf:"bytes,2,opt,name=payment_destination,json=paymentDestination,proto3" json:"payment_destination,omitempty"` + // Keypair auth using an out-of-band verification private key + Auth *v11.Auth `protobuf:"bytes,3,opt,name=auth,proto3" json:"auth,omitempty"` +} + +func (x *VerifiedPhoneConnection) Reset() { + *x = VerifiedPhoneConnection{} + mi := &file_contact_v1_model_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VerifiedPhoneConnection) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifiedPhoneConnection) ProtoMessage() {} + +func (x *VerifiedPhoneConnection) ProtoReflect() protoreflect.Message { + mi := &file_contact_v1_model_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VerifiedPhoneConnection.ProtoReflect.Descriptor instead. +func (*VerifiedPhoneConnection) Descriptor() ([]byte, []int) { + return file_contact_v1_model_proto_rawDescGZIP(), []int{1} +} + +func (x *VerifiedPhoneConnection) GetPhoneNumber() *v1.PhoneNumber { + if x != nil { + return x.PhoneNumber + } + return nil +} + +func (x *VerifiedPhoneConnection) GetPaymentDestination() *v11.PublicKey { + if x != nil { + return x.PaymentDestination + } + return nil +} + +func (x *VerifiedPhoneConnection) GetAuth() *v11.Auth { + if x != nil { + return x.Auth + } + return nil +} + +var File_contact_v1_model_proto protoreflect.FileDescriptor + +var file_contact_v1_model_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, + 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x16, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x01, 0x0a, 0x0f, 0x46, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, + 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x3e, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, + 0x73, 0x68, 0x2e, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x68, 0x6f, 0x6e, + 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, + 0x01, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x37, 0x0a, 0x18, 0x69, 0x73, 0x5f, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x70, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x69, 0x73, 0x43, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x22, 0xf8, 0x01, 0x0a, 0x17, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x50, 0x68, + 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4b, 0x0a, + 0x0c, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x70, + 0x68, 0x6f, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x70, + 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x58, 0x0a, 0x13, 0x70, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, + 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, + 0x52, 0x12, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x42, 0x08, 0xfa, 0x42, + 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x42, 0x53, 0x5a, 0x51, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2d, + 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x73, + 0x68, 0x32, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x70, 0x69, 0x2f, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_contact_v1_model_proto_rawDescOnce sync.Once + file_contact_v1_model_proto_rawDescData = file_contact_v1_model_proto_rawDesc +) + +func file_contact_v1_model_proto_rawDescGZIP() []byte { + file_contact_v1_model_proto_rawDescOnce.Do(func() { + file_contact_v1_model_proto_rawDescData = protoimpl.X.CompressGZIP(file_contact_v1_model_proto_rawDescData) + }) + return file_contact_v1_model_proto_rawDescData +} + +var file_contact_v1_model_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_contact_v1_model_proto_goTypes = []any{ + (*FlipcashContact)(nil), // 0: flipcash.contact.v1.FlipcashContact + (*VerifiedPhoneConnection)(nil), // 1: flipcash.contact.v1.VerifiedPhoneConnection + (*v1.PhoneNumber)(nil), // 2: flipcash.phone.v1.PhoneNumber + (*v11.PublicKey)(nil), // 3: flipcash.common.v1.PublicKey + (*v11.Auth)(nil), // 4: flipcash.common.v1.Auth +} +var file_contact_v1_model_proto_depIdxs = []int32{ + 2, // 0: flipcash.contact.v1.FlipcashContact.phone:type_name -> flipcash.phone.v1.PhoneNumber + 2, // 1: flipcash.contact.v1.VerifiedPhoneConnection.phone_number:type_name -> flipcash.phone.v1.PhoneNumber + 3, // 2: flipcash.contact.v1.VerifiedPhoneConnection.payment_destination:type_name -> flipcash.common.v1.PublicKey + 4, // 3: flipcash.contact.v1.VerifiedPhoneConnection.auth:type_name -> flipcash.common.v1.Auth + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_contact_v1_model_proto_init() } +func file_contact_v1_model_proto_init() { + if File_contact_v1_model_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_contact_v1_model_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_contact_v1_model_proto_goTypes, + DependencyIndexes: file_contact_v1_model_proto_depIdxs, + MessageInfos: file_contact_v1_model_proto_msgTypes, + }.Build() + File_contact_v1_model_proto = out.File + file_contact_v1_model_proto_rawDesc = nil + file_contact_v1_model_proto_goTypes = nil + file_contact_v1_model_proto_depIdxs = nil +} diff --git a/generated/go/contact/v1/model.pb.validate.go b/generated/go/contact/v1/model.pb.validate.go new file mode 100644 index 0000000..9ca868f --- /dev/null +++ b/generated/go/contact/v1/model.pb.validate.go @@ -0,0 +1,400 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: contact/v1/model.proto + +package contactpb + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on FlipcashContact with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *FlipcashContact) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on FlipcashContact with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// FlipcashContactMultiError, or nil if none found. +func (m *FlipcashContact) ValidateAll() error { + return m.validate(true) +} + +func (m *FlipcashContact) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetPhone() == nil { + err := FlipcashContactValidationError{ + field: "Phone", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetPhone()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, FlipcashContactValidationError{ + field: "Phone", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, FlipcashContactValidationError{ + field: "Phone", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPhone()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FlipcashContactValidationError{ + field: "Phone", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for IsConnectedForPayment + + if len(errors) > 0 { + return FlipcashContactMultiError(errors) + } + + return nil +} + +// FlipcashContactMultiError is an error wrapping multiple validation errors +// returned by FlipcashContact.ValidateAll() if the designated constraints +// aren't met. +type FlipcashContactMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m FlipcashContactMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m FlipcashContactMultiError) AllErrors() []error { return m } + +// FlipcashContactValidationError is the validation error returned by +// FlipcashContact.Validate if the designated constraints aren't met. +type FlipcashContactValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e FlipcashContactValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e FlipcashContactValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e FlipcashContactValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e FlipcashContactValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e FlipcashContactValidationError) ErrorName() string { return "FlipcashContactValidationError" } + +// Error satisfies the builtin error interface +func (e FlipcashContactValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sFlipcashContact.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = FlipcashContactValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = FlipcashContactValidationError{} + +// Validate checks the field values on VerifiedPhoneConnection with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *VerifiedPhoneConnection) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on VerifiedPhoneConnection with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// VerifiedPhoneConnectionMultiError, or nil if none found. +func (m *VerifiedPhoneConnection) ValidateAll() error { + return m.validate(true) +} + +func (m *VerifiedPhoneConnection) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetPhoneNumber() == nil { + err := VerifiedPhoneConnectionValidationError{ + field: "PhoneNumber", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetPhoneNumber()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, VerifiedPhoneConnectionValidationError{ + field: "PhoneNumber", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, VerifiedPhoneConnectionValidationError{ + field: "PhoneNumber", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPhoneNumber()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return VerifiedPhoneConnectionValidationError{ + field: "PhoneNumber", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.GetPaymentDestination() == nil { + err := VerifiedPhoneConnectionValidationError{ + field: "PaymentDestination", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetPaymentDestination()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, VerifiedPhoneConnectionValidationError{ + field: "PaymentDestination", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, VerifiedPhoneConnectionValidationError{ + field: "PaymentDestination", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPaymentDestination()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return VerifiedPhoneConnectionValidationError{ + field: "PaymentDestination", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.GetAuth() == nil { + err := VerifiedPhoneConnectionValidationError{ + field: "Auth", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetAuth()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, VerifiedPhoneConnectionValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, VerifiedPhoneConnectionValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAuth()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return VerifiedPhoneConnectionValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return VerifiedPhoneConnectionMultiError(errors) + } + + return nil +} + +// VerifiedPhoneConnectionMultiError is an error wrapping multiple validation +// errors returned by VerifiedPhoneConnection.ValidateAll() if the designated +// constraints aren't met. +type VerifiedPhoneConnectionMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m VerifiedPhoneConnectionMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m VerifiedPhoneConnectionMultiError) AllErrors() []error { return m } + +// VerifiedPhoneConnectionValidationError is the validation error returned by +// VerifiedPhoneConnection.Validate if the designated constraints aren't met. +type VerifiedPhoneConnectionValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e VerifiedPhoneConnectionValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e VerifiedPhoneConnectionValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e VerifiedPhoneConnectionValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e VerifiedPhoneConnectionValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e VerifiedPhoneConnectionValidationError) ErrorName() string { + return "VerifiedPhoneConnectionValidationError" +} + +// Error satisfies the builtin error interface +func (e VerifiedPhoneConnectionValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sVerifiedPhoneConnection.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = VerifiedPhoneConnectionValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = VerifiedPhoneConnectionValidationError{} diff --git a/generated/protobuf-es/contact/v1/contact_list_service_connect.ts b/generated/protobuf-es/contact/v1/contact_list_service_connect.ts new file mode 100644 index 0000000..ada4fe6 --- /dev/null +++ b/generated/protobuf-es/contact/v1/contact_list_service_connect.ts @@ -0,0 +1,91 @@ +// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts" +// @generated from file contact/v1/contact_list_service.proto (package flipcash.contact.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { CheckSyncRequest, CheckSyncResponse, ConnectRequest, ConnectResponse, DeltaUploadRequest, DeltaUploadResponse, FullUploadRequest, FullUploadResponse, GetFlipcashContactsRequest, GetFlipcashContactsResponse } from "./contact_list_service_pb"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * ContactList manages a user's contact list and surfaces which contacts are + * Flipcash users. + * + * Sync model: + * - The client maintains a 32-byte XOR-of-SHA256 checksum over its current + * contact set, and an OS-specific cursor for incremental change discovery. + * The cursor is local-only and never leaves the device. + * - Steady state: client computes a delta from the OS cursor, sends it via + * DeltaUpload with old/new checksums for compare-and-swap. + * - Recovery: on first install, after OS history truncation, or after + * CHECKSUM_DRIFT, the client uses FullUpload to replace the server's state + * wholesale. + * + * @generated from service flipcash.contact.v1.ContactList + */ +export const ContactList = { + typeName: "flipcash.contact.v1.ContactList", + methods: { + /** + * CheckSync compares the client's checksum to the server's. Cheap, used + * on app foreground to decide whether any upload is needed. + * + * @generated from rpc flipcash.contact.v1.ContactList.CheckSync + */ + checkSync: { + name: "CheckSync", + I: CheckSyncRequest, + O: CheckSyncResponse, + kind: MethodKind.Unary, + }, + /** + * DeltaUpload applies a delta under compare-and-swap on the checksum. + * Safe to retry indefinitely with the same payload. + * + * @generated from rpc flipcash.contact.v1.ContactList.DeltaUpload + */ + deltaUpload: { + name: "DeltaUpload", + I: DeltaUploadRequest, + O: DeltaUploadResponse, + kind: MethodKind.Unary, + }, + /** + * FullUpload replaces the user's contact set entirely. Used when + * a delta cannot be constructed or CHECKSUM_DRIFT was returned. + * + * @generated from rpc flipcash.contact.v1.ContactList.FullUpload + */ + fullUpload: { + name: "FullUpload", + I: FullUploadRequest, + O: FullUploadResponse, + kind: MethodKind.ClientStreaming, + }, + /** + * GetFlipcashContacts gets the set of contacts that are on Flipcash + * + * @generated from rpc flipcash.contact.v1.ContactList.GetFlipcashContacts + */ + getFlipcashContacts: { + name: "GetFlipcashContacts", + I: GetFlipcashContactsRequest, + O: GetFlipcashContactsResponse, + kind: MethodKind.ServerStreaming, + }, + /** + * Connect connects a contact for payment using a verifiable proto messaged + * signed with an out-of-band verification key. Both contacts must connect + * with the same verification key to enable payments. The verification key + * must be stored in secure storage prior to calling this RPC. + * + * @generated from rpc flipcash.contact.v1.ContactList.Connect + */ + connect: { + name: "Connect", + I: ConnectRequest, + O: ConnectResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/generated/protobuf-es/contact/v1/contact_list_service_pb.ts b/generated/protobuf-es/contact/v1/contact_list_service_pb.ts new file mode 100644 index 0000000..a730514 --- /dev/null +++ b/generated/protobuf-es/contact/v1/contact_list_service_pb.ts @@ -0,0 +1,584 @@ +// @generated by protoc-gen-es v1.10.1 with parameter "target=ts" +// @generated from file contact/v1/contact_list_service.proto (package flipcash.contact.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { Auth } from "../../common/v1/common_pb"; +import { PhoneNumber } from "../../phone/v1/model_pb"; +import { FlipcashContact, VerifiedPhoneConnection } from "./model_pb"; + +/** + * @generated from message flipcash.contact.v1.CheckSyncRequest + */ +export class CheckSyncRequest extends Message { + /** + * @generated from field: flipcash.common.v1.Auth auth = 1; + */ + auth?: Auth; + + /** + * XOR-of-SHA256 over the client's current set of normalized E.164 phones. + * + * @generated from field: bytes client_checksum = 2; + */ + clientChecksum = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "flipcash.contact.v1.CheckSyncRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "auth", kind: "message", T: Auth }, + { no: 2, name: "client_checksum", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CheckSyncRequest { + return new CheckSyncRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CheckSyncRequest { + return new CheckSyncRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CheckSyncRequest { + return new CheckSyncRequest().fromJsonString(jsonString, options); + } + + static equals(a: CheckSyncRequest | PlainMessage | undefined, b: CheckSyncRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CheckSyncRequest, a, b); + } +} + +/** + * @generated from message flipcash.contact.v1.CheckSyncResponse + */ +export class CheckSyncResponse extends Message { + /** + * @generated from field: flipcash.contact.v1.CheckSyncResponse.Result result = 1; + */ + result = CheckSyncResponse_Result.OK; + + /** + * Authoritative server-side checksum. Clients persist this and use it + * as the basis for the next DeltaUpload.old_checksum. + * + * @generated from field: bytes server_checksum = 2; + */ + serverChecksum = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "flipcash.contact.v1.CheckSyncResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(CheckSyncResponse_Result) }, + { no: 2, name: "server_checksum", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CheckSyncResponse { + return new CheckSyncResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CheckSyncResponse { + return new CheckSyncResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CheckSyncResponse { + return new CheckSyncResponse().fromJsonString(jsonString, options); + } + + static equals(a: CheckSyncResponse | PlainMessage | undefined, b: CheckSyncResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CheckSyncResponse, a, b); + } +} + +/** + * @generated from enum flipcash.contact.v1.CheckSyncResponse.Result + */ +export enum CheckSyncResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, + + /** + * @generated from enum value: OUT_OF_SYNC = 1; + */ + OUT_OF_SYNC = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(CheckSyncResponse_Result) +proto3.util.setEnumType(CheckSyncResponse_Result, "flipcash.contact.v1.CheckSyncResponse.Result", [ + { no: 0, name: "OK" }, + { no: 1, name: "OUT_OF_SYNC" }, +]); + +/** + * @generated from message flipcash.contact.v1.DeltaUploadRequest + */ +export class DeltaUploadRequest extends Message { + /** + * @generated from field: flipcash.common.v1.Auth auth = 1; + */ + auth?: Auth; + + /** + * @generated from field: repeated flipcash.phone.v1.PhoneNumber adds = 2; + */ + adds: PhoneNumber[] = []; + + /** + * @generated from field: repeated flipcash.phone.v1.PhoneNumber removes = 3; + */ + removes: PhoneNumber[] = []; + + /** + * The checksum the client expected the server to have *before* applying + * this delta. Server applies only if stored == old_checksum. + * + * @generated from field: bytes old_checksum = 4; + */ + oldChecksum = new Uint8Array(0); + + /** + * The checksum the client computes for the state *after* applying this + * delta. Server persists this on success. Used to detect retries: if + * stored == new_checksum, the server treats the request as a no-op. + * + * @generated from field: bytes new_checksum = 5; + */ + newChecksum = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "flipcash.contact.v1.DeltaUploadRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "auth", kind: "message", T: Auth }, + { no: 2, name: "adds", kind: "message", T: PhoneNumber, repeated: true }, + { no: 3, name: "removes", kind: "message", T: PhoneNumber, repeated: true }, + { no: 4, name: "old_checksum", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + { no: 5, name: "new_checksum", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeltaUploadRequest { + return new DeltaUploadRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeltaUploadRequest { + return new DeltaUploadRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeltaUploadRequest { + return new DeltaUploadRequest().fromJsonString(jsonString, options); + } + + static equals(a: DeltaUploadRequest | PlainMessage | undefined, b: DeltaUploadRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeltaUploadRequest, a, b); + } +} + +/** + * @generated from message flipcash.contact.v1.DeltaUploadResponse + */ +export class DeltaUploadResponse extends Message { + /** + * @generated from field: flipcash.contact.v1.DeltaUploadResponse.Result result = 1; + */ + result = DeltaUploadResponse_Result.OK; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "flipcash.contact.v1.DeltaUploadResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(DeltaUploadResponse_Result) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeltaUploadResponse { + return new DeltaUploadResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeltaUploadResponse { + return new DeltaUploadResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeltaUploadResponse { + return new DeltaUploadResponse().fromJsonString(jsonString, options); + } + + static equals(a: DeltaUploadResponse | PlainMessage | undefined, b: DeltaUploadResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DeltaUploadResponse, a, b); + } +} + +/** + * @generated from enum flipcash.contact.v1.DeltaUploadResponse.Result + */ +export enum DeltaUploadResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, + + /** + * Stored checksum matched neither old_checksum nor new_checksum. + * Client should call FullUpload to reconcile. + * + * @generated from enum value: CHECKSUM_DRIFT = 1; + */ + CHECKSUM_DRIFT = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(DeltaUploadResponse_Result) +proto3.util.setEnumType(DeltaUploadResponse_Result, "flipcash.contact.v1.DeltaUploadResponse.Result", [ + { no: 0, name: "OK" }, + { no: 1, name: "CHECKSUM_DRIFT" }, +]); + +/** + * @generated from message flipcash.contact.v1.FullUploadRequest + */ +export class FullUploadRequest extends Message { + /** + * @generated from field: flipcash.common.v1.Auth auth = 1; + */ + auth?: Auth; + + /** + * The complete current contact set. Server replaces stored state with + * this list in one transaction. + * + * @generated from field: repeated flipcash.phone.v1.PhoneNumber phones = 2; + */ + phones: PhoneNumber[] = []; + + /** + * XOR-of-SHA256 over the client's current set of normalized E.164 phones. + * Sent on the last streamed request to indicate the end of the upload. + * + * @generated from field: bytes expected_checksum = 3; + */ + expectedChecksum = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "flipcash.contact.v1.FullUploadRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "auth", kind: "message", T: Auth }, + { no: 2, name: "phones", kind: "message", T: PhoneNumber, repeated: true }, + { no: 3, name: "expected_checksum", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): FullUploadRequest { + return new FullUploadRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): FullUploadRequest { + return new FullUploadRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): FullUploadRequest { + return new FullUploadRequest().fromJsonString(jsonString, options); + } + + static equals(a: FullUploadRequest | PlainMessage | undefined, b: FullUploadRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(FullUploadRequest, a, b); + } +} + +/** + * @generated from message flipcash.contact.v1.FullUploadResponse + */ +export class FullUploadResponse extends Message { + /** + * @generated from field: flipcash.contact.v1.FullUploadResponse.Result result = 1; + */ + result = FullUploadResponse_Result.OK; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "flipcash.contact.v1.FullUploadResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(FullUploadResponse_Result) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): FullUploadResponse { + return new FullUploadResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): FullUploadResponse { + return new FullUploadResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): FullUploadResponse { + return new FullUploadResponse().fromJsonString(jsonString, options); + } + + static equals(a: FullUploadResponse | PlainMessage | undefined, b: FullUploadResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(FullUploadResponse, a, b); + } +} + +/** + * @generated from enum flipcash.contact.v1.FullUploadResponse.Result + */ +export enum FullUploadResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, + + /** + * Server's recomputed checksum did not match expected_checksum. + * + * @generated from enum value: CHECKSUM_MISMATCH = 1; + */ + CHECKSUM_MISMATCH = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(FullUploadResponse_Result) +proto3.util.setEnumType(FullUploadResponse_Result, "flipcash.contact.v1.FullUploadResponse.Result", [ + { no: 0, name: "OK" }, + { no: 1, name: "CHECKSUM_MISMATCH" }, +]); + +/** + * @generated from message flipcash.contact.v1.GetFlipcashContactsRequest + */ +export class GetFlipcashContactsRequest extends Message { + /** + * @generated from field: flipcash.common.v1.Auth auth = 1; + */ + auth?: Auth; + + /** + * @generated from field: bytes checksum = 2; + */ + checksum = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "flipcash.contact.v1.GetFlipcashContactsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "auth", kind: "message", T: Auth }, + { no: 2, name: "checksum", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetFlipcashContactsRequest { + return new GetFlipcashContactsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetFlipcashContactsRequest { + return new GetFlipcashContactsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetFlipcashContactsRequest { + return new GetFlipcashContactsRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetFlipcashContactsRequest | PlainMessage | undefined, b: GetFlipcashContactsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetFlipcashContactsRequest, a, b); + } +} + +/** + * @generated from message flipcash.contact.v1.GetFlipcashContactsResponse + */ +export class GetFlipcashContactsResponse extends Message { + /** + * @generated from field: flipcash.contact.v1.GetFlipcashContactsResponse.Result result = 1; + */ + result = GetFlipcashContactsResponse_Result.OK; + + /** + * @generated from field: repeated flipcash.contact.v1.FlipcashContact contacts = 2; + */ + contacts: FlipcashContact[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "flipcash.contact.v1.GetFlipcashContactsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(GetFlipcashContactsResponse_Result) }, + { no: 2, name: "contacts", kind: "message", T: FlipcashContact, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetFlipcashContactsResponse { + return new GetFlipcashContactsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetFlipcashContactsResponse { + return new GetFlipcashContactsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetFlipcashContactsResponse { + return new GetFlipcashContactsResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetFlipcashContactsResponse | PlainMessage | undefined, b: GetFlipcashContactsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetFlipcashContactsResponse, a, b); + } +} + +/** + * @generated from enum flipcash.contact.v1.GetFlipcashContactsResponse.Result + */ +export enum GetFlipcashContactsResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, + + /** + * Server checksum doesn't match client checksum. + * + * @generated from enum value: CHECKSUM_DRIFT = 1; + */ + CHECKSUM_DRIFT = 1, + + /** + * @generated from enum value: NOT_FOUND = 2; + */ + NOT_FOUND = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(GetFlipcashContactsResponse_Result) +proto3.util.setEnumType(GetFlipcashContactsResponse_Result, "flipcash.contact.v1.GetFlipcashContactsResponse.Result", [ + { no: 0, name: "OK" }, + { no: 1, name: "CHECKSUM_DRIFT" }, + { no: 2, name: "NOT_FOUND" }, +]); + +/** + * @generated from message flipcash.contact.v1.ConnectRequest + */ +export class ConnectRequest extends Message { + /** + * @generated from field: flipcash.common.v1.Auth auth = 1; + */ + auth?: Auth; + + /** + * @generated from field: flipcash.contact.v1.VerifiedPhoneConnection verified_connection = 2; + */ + verifiedConnection?: VerifiedPhoneConnection; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "flipcash.contact.v1.ConnectRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "auth", kind: "message", T: Auth }, + { no: 2, name: "verified_connection", kind: "message", T: VerifiedPhoneConnection }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConnectRequest { + return new ConnectRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConnectRequest { + return new ConnectRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConnectRequest { + return new ConnectRequest().fromJsonString(jsonString, options); + } + + static equals(a: ConnectRequest | PlainMessage | undefined, b: ConnectRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ConnectRequest, a, b); + } +} + +/** + * @generated from message flipcash.contact.v1.ConnectResponse + */ +export class ConnectResponse extends Message { + /** + * @generated from field: flipcash.contact.v1.ConnectResponse.Result result = 1; + */ + result = ConnectResponse_Result.OK; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "flipcash.contact.v1.ConnectResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(ConnectResponse_Result) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConnectResponse { + return new ConnectResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConnectResponse { + return new ConnectResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConnectResponse { + return new ConnectResponse().fromJsonString(jsonString, options); + } + + static equals(a: ConnectResponse | PlainMessage | undefined, b: ConnectResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ConnectResponse, a, b); + } +} + +/** + * @generated from enum flipcash.contact.v1.ConnectResponse.Result + */ +export enum ConnectResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, + + /** + * @generated from enum value: DENIED = 1; + */ + DENIED = 1, + + /** + * @generated from enum value: VERIFICATION_KEY_NOT_FOUND = 2; + */ + VERIFICATION_KEY_NOT_FOUND = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(ConnectResponse_Result) +proto3.util.setEnumType(ConnectResponse_Result, "flipcash.contact.v1.ConnectResponse.Result", [ + { no: 0, name: "OK" }, + { no: 1, name: "DENIED" }, + { no: 2, name: "VERIFICATION_KEY_NOT_FOUND" }, +]); + diff --git a/generated/protobuf-es/contact/v1/index.ts b/generated/protobuf-es/contact/v1/index.ts new file mode 100644 index 0000000..26978fb --- /dev/null +++ b/generated/protobuf-es/contact/v1/index.ts @@ -0,0 +1,3 @@ +export * from './contact_list_service_pb'; +export * from './model_pb'; +export * from './contact_list_service_connect'; diff --git a/generated/protobuf-es/contact/v1/model_pb.ts b/generated/protobuf-es/contact/v1/model_pb.ts new file mode 100644 index 0000000..49a4525 --- /dev/null +++ b/generated/protobuf-es/contact/v1/model_pb.ts @@ -0,0 +1,106 @@ +// @generated by protoc-gen-es v1.10.1 with parameter "target=ts" +// @generated from file contact/v1/model.proto (package flipcash.contact.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { PhoneNumber } from "../../phone/v1/model_pb"; +import { Auth, PublicKey } from "../../common/v1/common_pb"; + +/** + * @generated from message flipcash.contact.v1.FlipcashContact + */ +export class FlipcashContact extends Message { + /** + * @generated from field: flipcash.phone.v1.PhoneNumber phone = 1; + */ + phone?: PhoneNumber; + + /** + * Is this contact connected for payment? + * + * @generated from field: bool is_connected_for_payment = 2; + */ + isConnectedForPayment = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "flipcash.contact.v1.FlipcashContact"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "phone", kind: "message", T: PhoneNumber }, + { no: 2, name: "is_connected_for_payment", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): FlipcashContact { + return new FlipcashContact().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): FlipcashContact { + return new FlipcashContact().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): FlipcashContact { + return new FlipcashContact().fromJsonString(jsonString, options); + } + + static equals(a: FlipcashContact | PlainMessage | undefined, b: FlipcashContact | PlainMessage | undefined): boolean { + return proto3.util.equals(FlipcashContact, a, b); + } +} + +/** + * @generated from message flipcash.contact.v1.VerifiedPhoneConnection + */ +export class VerifiedPhoneConnection extends Message { + /** + * @generated from field: flipcash.phone.v1.PhoneNumber phone_number = 1; + */ + phoneNumber?: PhoneNumber; + + /** + * @generated from field: flipcash.common.v1.PublicKey payment_destination = 2; + */ + paymentDestination?: PublicKey; + + /** + * Keypair auth using an out-of-band verification private key + * + * @generated from field: flipcash.common.v1.Auth auth = 3; + */ + auth?: Auth; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "flipcash.contact.v1.VerifiedPhoneConnection"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "phone_number", kind: "message", T: PhoneNumber }, + { no: 2, name: "payment_destination", kind: "message", T: PublicKey }, + { no: 3, name: "auth", kind: "message", T: Auth }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): VerifiedPhoneConnection { + return new VerifiedPhoneConnection().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): VerifiedPhoneConnection { + return new VerifiedPhoneConnection().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): VerifiedPhoneConnection { + return new VerifiedPhoneConnection().fromJsonString(jsonString, options); + } + + static equals(a: VerifiedPhoneConnection | PlainMessage | undefined, b: VerifiedPhoneConnection | PlainMessage | undefined): boolean { + return proto3.util.equals(VerifiedPhoneConnection, a, b); + } +} + diff --git a/generated/protobuf-es/index.ts b/generated/protobuf-es/index.ts index d55f1ca..dc64858 100644 --- a/generated/protobuf-es/index.ts +++ b/generated/protobuf-es/index.ts @@ -1,4 +1,6 @@ export * as Settings from './settings/v1'; +export * as Contact from './contact/v1'; +export * as Contact from './contact/v1'; export * as Activity from './activity/v1'; export * as Activity from './activity/v1'; export * as Push from './push/v1'; diff --git a/proto/contact/v1/contact_list_service.proto b/proto/contact/v1/contact_list_service.proto new file mode 100644 index 0000000..7ad3fee --- /dev/null +++ b/proto/contact/v1/contact_list_service.proto @@ -0,0 +1,146 @@ +syntax = "proto3"; + +package flipcash.contact.v1; + +import "contact/v1/model.proto"; +import "common/v1/common.proto"; +import "phone/v1/model.proto"; +import "validate/validate.proto"; + +option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/contact/v1;contactpb"; + +// ContactList manages a user's contact list and surfaces which contacts are +// Flipcash users. +// +// Sync model: +// - The client maintains a 32-byte XOR-of-SHA256 checksum over its current +// contact set, and an OS-specific cursor for incremental change discovery. +// The cursor is local-only and never leaves the device. +// - Steady state: client computes a delta from the OS cursor, sends it via +// DeltaUpload with old/new checksums for compare-and-swap. +// - Recovery: on first install, after OS history truncation, or after +// CHECKSUM_DRIFT, the client uses FullUpload to replace the server's state +// wholesale. +service ContactList { + // CheckSync compares the client's checksum to the server's. Cheap, used + // on app foreground to decide whether any upload is needed. + rpc CheckSync(CheckSyncRequest) returns (CheckSyncResponse); + + // DeltaUpload applies a delta under compare-and-swap on the checksum. + // Safe to retry indefinitely with the same payload. + rpc DeltaUpload(DeltaUploadRequest) returns (DeltaUploadResponse); + + // FullUpload replaces the user's contact set entirely. Used when + // a delta cannot be constructed or CHECKSUM_DRIFT was returned. + rpc FullUpload(stream FullUploadRequest) returns (FullUploadResponse); + + // GetFlipcashContacts gets the set of contacts that are on Flipcash + rpc GetFlipcashContacts(GetFlipcashContactsRequest) returns (stream GetFlipcashContactsResponse); + + // Connect connects a contact for payment using a verifiable proto messaged + // signed with an out-of-band verification key. Both contacts must connect + // with the same verification key to enable payments. The verification key + // must be stored in secure storage prior to calling this RPC. + rpc Connect(ConnectRequest) returns (ConnectResponse); +} + + +message CheckSyncRequest { + common.v1.Auth auth = 1 [(validate.rules).message.required = true]; + + // XOR-of-SHA256 over the client's current set of normalized E.164 phones. + bytes client_checksum = 2 [(validate.rules).bytes.len = 32]; +} + +message CheckSyncResponse { + enum Result { + OK = 0; + OUT_OF_SYNC = 1; + } + Result result = 1; + + // Authoritative server-side checksum. Clients persist this and use it + // as the basis for the next DeltaUpload.old_checksum. + bytes server_checksum = 2 [(validate.rules).bytes.len = 32]; +} + +message DeltaUploadRequest { + common.v1.Auth auth = 1 [(validate.rules).message.required = true]; + + repeated phone.v1.PhoneNumber adds = 2 [(validate.rules).repeated.max_items = 1000]; + + repeated phone.v1.PhoneNumber removes = 3 [(validate.rules).repeated.max_items = 1000]; + + // The checksum the client expected the server to have *before* applying + // this delta. Server applies only if stored == old_checksum. + bytes old_checksum = 4 [(validate.rules).bytes.len = 32]; + + // The checksum the client computes for the state *after* applying this + // delta. Server persists this on success. Used to detect retries: if + // stored == new_checksum, the server treats the request as a no-op. + bytes new_checksum = 5 [(validate.rules).bytes.len = 32]; +} + +message DeltaUploadResponse { + enum Result { + OK = 0; + // Stored checksum matched neither old_checksum nor new_checksum. + // Client should call FullUpload to reconcile. + CHECKSUM_DRIFT = 1; + } + Result result = 1; +} + +message FullUploadRequest { + common.v1.Auth auth = 1 [(validate.rules).message.required = true]; + + // The complete current contact set. Server replaces stored state with + // this list in one transaction. + repeated phone.v1.PhoneNumber phones = 2 [(validate.rules).repeated.max_items = 1000]; + + // XOR-of-SHA256 over the client's current set of normalized E.164 phones. + // Sent on the last streamed request to indicate the end of the upload. + bytes expected_checksum = 3; +} + +message FullUploadResponse { + enum Result { + OK = 0; + // Server's recomputed checksum did not match expected_checksum. + CHECKSUM_MISMATCH = 1; + } + Result result = 1; +} + +message GetFlipcashContactsRequest { + common.v1.Auth auth = 1 [(validate.rules).message.required = true]; + + bytes checksum = 2 [(validate.rules).bytes.len = 32]; +} + +message GetFlipcashContactsResponse { + enum Result { + OK = 0; + // Server checksum doesn't match client checksum. + CHECKSUM_DRIFT = 1; + NOT_FOUND = 2; + } + Result result = 1; + + repeated FlipcashContact contacts = 2 [(validate.rules).repeated.max_items = 1000]; +} + +message ConnectRequest { + common.v1.Auth auth = 1 [(validate.rules).message.required = true]; + + VerifiedPhoneConnection verified_connection = 2 [(validate.rules).message.required = true]; +} + +message ConnectResponse { + enum Result { + OK = 0; + DENIED = 1; + VERIFICATION_KEY_NOT_FOUND = 2; + } + Result result = 1; +} diff --git a/proto/contact/v1/model.proto b/proto/contact/v1/model.proto new file mode 100644 index 0000000..cee2891 --- /dev/null +++ b/proto/contact/v1/model.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package flipcash.contact.v1; + +import "common/v1/common.proto"; +import "phone/v1/model.proto"; +import "validate/validate.proto"; + +option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/contact/v1;contactpb"; + +message FlipcashContact { + phone.v1.PhoneNumber phone = 1 [(validate.rules).message.required = true]; + + // Is this contact connected for payment? + bool is_connected_for_payment = 2; +} + +message VerifiedPhoneConnection { + phone.v1.PhoneNumber phone_number = 1 [(validate.rules).message.required = true]; + + common.v1.PublicKey payment_destination = 2 [(validate.rules).message.required = true]; + + // Keypair auth using an out-of-band verification private key + common.v1.Auth auth = 3 [(validate.rules).message.required = true]; +}