From 7f382495f9eeb943a721dc2379ad743fa5bd2ba3 Mon Sep 17 00:00:00 2001 From: Andrei Maskalenka Date: Mon, 25 Jun 2018 19:58:04 +0300 Subject: [PATCH] resource identifier integration (#39) --- Gopkg.lock | 8 +- Gopkg.toml | 4 - cmd/server/errormapping.go | 5 +- cmd/server/grpc.go | 2 - cmd/server/main.go | 3 + pkg/pb/contacts.pb.go | 1431 ++++++++++++++++++++++++++---------- pkg/pb/contacts.pb.gorm.go | 277 ++++--- pkg/pb/contacts.pb.gw.go | 154 ++-- pkg/pb/contacts.proto | 41 +- pkg/svc/zserver.go | 2 +- 10 files changed, 1337 insertions(+), 590 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index deb697f..1f409cb 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -30,7 +30,7 @@ "ptypes/struct", "ptypes/timestamp" ] - revision = "9f81198da99b79e14d70ca2c3cc1bbe44c6e69b6" + revision = "9eb2c01ac278a5d89ce4b2be68fe4500955d8179" [[projects]] name = "github.com/google/uuid" @@ -79,14 +79,16 @@ "errors", "gateway", "gorm", + "gorm/resource", "health", "query", "requestid", "rpc/errdetails", "rpc/errfields", + "rpc/resource", "server" ] - revision = "9d03e373ef7f6a2a753dd098873a25b147037738" + revision = "1498dd01b71c7ef524204741041ae42c77e8c60e" [[projects]] branch = "master" @@ -274,6 +276,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "80aff91b2508656c97b70aeb724afb7321aa06e884f4ef19b96c59d746157e6a" + inputs-digest = "26784b2fdffa99197ffad8ace3f07dd17c042c0e4b7cde5b83fe3d5882a4b7d1" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 1d29df8..4a55de0 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -26,10 +26,6 @@ name = "google.golang.org/grpc" version = "1.11.2" -[[constraint]] - name = "github.com/infobloxopen/atlas-app-toolkit" - branch = "master" - [prune] go-tests = true unused-packages = true diff --git a/cmd/server/errormapping.go b/cmd/server/errormapping.go index 2cc4951..3a351e0 100644 --- a/cmd/server/errormapping.go +++ b/cmd/server/errormapping.go @@ -20,7 +20,7 @@ var ErrorMappings = []errors.MapFunc{ errors.NewMapping( errors.CondHasPrefix("pq:"), - errors.MapFunc(func (ctx context.Context, err error) (error, bool) { + errors.MapFunc(func(ctx context.Context, err error) (error, bool) { if res := regexp.MustCompile(`column "(\w+)" does not exist`).FindStringSubmatch(err.Error()); len(res) > 0 { return errors.NewContainer(codes.InvalidArgument, "Invalid collection operator parameter %q.", res[1]), true } @@ -32,9 +32,8 @@ var ErrorMappings = []errors.MapFunc{ errors.NewMapping( // Here CondAnd without condition functions serves as 'default'. errors.CondAnd(), - errors.MapFunc(func (ctx context.Context, err error) (error, bool) { + errors.MapFunc(func(ctx context.Context, err error) (error, bool) { return errors.NewContainer(codes.Internal, "Error: %s", err), true }), ), - } diff --git a/cmd/server/grpc.go b/cmd/server/grpc.go index a1585d0..a61077f 100644 --- a/cmd/server/grpc.go +++ b/cmd/server/grpc.go @@ -7,7 +7,6 @@ import ( toolkit_auth "github.com/infobloxopen/atlas-app-toolkit/auth" "github.com/infobloxopen/atlas-app-toolkit/gateway" "github.com/infobloxopen/atlas-app-toolkit/requestid" - "github.com/infobloxopen/atlas-app-toolkit/errors" "github.com/infobloxopen/atlas-contacts-app/pkg/pb" "github.com/infobloxopen/atlas-contacts-app/pkg/svc" "github.com/jinzhu/gorm" @@ -21,7 +20,6 @@ func NewGRPCServer(logger *logrus.Logger, db *gorm.DB) (*grpc.Server, error) { // validation interceptor grpc_validator.UnaryServerInterceptor(), grpc_logrus.UnaryServerInterceptor(logrus.NewEntry(logger)), - errors.UnaryServerInterceptor(ErrorMappings...), gateway.UnaryServerInterceptor(), requestid.UnaryServerInterceptor(), } diff --git a/cmd/server/main.go b/cmd/server/main.go index 4bea5d2..07c6891 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -13,7 +13,9 @@ import ( "time" "database/sql" + "github.com/infobloxopen/atlas-app-toolkit/gateway" + "github.com/infobloxopen/atlas-app-toolkit/gorm/resource" "github.com/infobloxopen/atlas-app-toolkit/health" "github.com/infobloxopen/atlas-app-toolkit/server" "github.com/infobloxopen/atlas-contacts-app/cmd" @@ -60,6 +62,7 @@ func init() { flag.StringVar(&AuthzAddr, "authz", "", "address of the authorization service") flag.StringVar(&LogLevel, "log", "info", "log level") flag.Parse() + resource.RegisterApplication("atlas-contacts-app") } func NewLogger() *logrus.Logger { diff --git a/pkg/pb/contacts.pb.go b/pkg/pb/contacts.pb.go index c61c12e..d0962e5 100644 --- a/pkg/pb/contacts.pb.go +++ b/pkg/pb/contacts.pb.go @@ -1,55 +1,18 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/infobloxopen/atlas-contacts-app/pkg/pb/contacts.proto - -/* -Package pb is a generated protocol buffer package. - -It is generated from these files: - github.com/infobloxopen/atlas-contacts-app/pkg/pb/contacts.proto - -It has these top-level messages: - Profile - CreateProfileRequest - CreateProfileResponse - ReadProfileRequest - ReadProfileResponse - UpdateProfileRequest - UpdateProfileResponse - DeleteProfileRequest - ListProfilesResponse - Group - CreateGroupRequest - CreateGroupResponse - ReadGroupRequest - ReadGroupResponse - UpdateGroupRequest - UpdateGroupResponse - DeleteGroupRequest - ListGroupsResponse - Contact - Email - Address - CreateContactRequest - CreateContactResponse - ReadContactRequest - ReadContactResponse - UpdateContactRequest - UpdateContactResponse - DeleteContactRequest - ListContactsResponse - SMSRequest -*/ -package pb +// source: pkg/pb/contacts.proto + +package pb // import "github.com/infobloxopen/atlas-contacts-app/pkg/pb" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import google_protobuf "github.com/golang/protobuf/ptypes/empty" -import _ "google.golang.org/genproto/googleapis/api/annotations" -import _ "github.com/lyft/protoc-gen-validate/validate" +import empty "github.com/golang/protobuf/ptypes/empty" import _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" +import resource "github.com/infobloxopen/atlas-app-toolkit/rpc/resource" import _ "github.com/infobloxopen/protoc-gen-gorm/options" -import gorm_types "github.com/infobloxopen/protoc-gen-gorm/types" +import types "github.com/infobloxopen/protoc-gen-gorm/types" +import _ "github.com/lyft/protoc-gen-validate/validate" +import _ "google.golang.org/genproto/googleapis/api/annotations" import ( context "golang.org/x/net/context" @@ -68,23 +31,45 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type Profile struct { - Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Notes string `protobuf:"bytes,3,opt,name=notes" json:"notes,omitempty"` - Contacts []*Contact `protobuf:"bytes,4,rep,name=contacts" json:"contacts,omitempty"` - Groups []*Group `protobuf:"bytes,5,rep,name=groups" json:"groups,omitempty"` + Id *resource.Identifier `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Notes string `protobuf:"bytes,3,opt,name=notes" json:"notes,omitempty"` + Contacts []*Contact `protobuf:"bytes,4,rep,name=contacts" json:"contacts,omitempty"` + Groups []*Group `protobuf:"bytes,5,rep,name=groups" json:"groups,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Profile) Reset() { *m = Profile{} } +func (m *Profile) String() string { return proto.CompactTextString(m) } +func (*Profile) ProtoMessage() {} +func (*Profile) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{0} +} +func (m *Profile) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Profile.Unmarshal(m, b) +} +func (m *Profile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Profile.Marshal(b, m, deterministic) +} +func (dst *Profile) XXX_Merge(src proto.Message) { + xxx_messageInfo_Profile.Merge(dst, src) +} +func (m *Profile) XXX_Size() int { + return xxx_messageInfo_Profile.Size(m) +} +func (m *Profile) XXX_DiscardUnknown() { + xxx_messageInfo_Profile.DiscardUnknown(m) } -func (m *Profile) Reset() { *m = Profile{} } -func (m *Profile) String() string { return proto.CompactTextString(m) } -func (*Profile) ProtoMessage() {} -func (*Profile) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +var xxx_messageInfo_Profile proto.InternalMessageInfo -func (m *Profile) GetId() uint64 { +func (m *Profile) GetId() *resource.Identifier { if m != nil { return m.Id } - return 0 + return nil } func (m *Profile) GetName() string { @@ -116,13 +101,35 @@ func (m *Profile) GetGroups() []*Group { } type CreateProfileRequest struct { - Payload *Profile `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + Payload *Profile `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *CreateProfileRequest) Reset() { *m = CreateProfileRequest{} } -func (m *CreateProfileRequest) String() string { return proto.CompactTextString(m) } -func (*CreateProfileRequest) ProtoMessage() {} -func (*CreateProfileRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (m *CreateProfileRequest) Reset() { *m = CreateProfileRequest{} } +func (m *CreateProfileRequest) String() string { return proto.CompactTextString(m) } +func (*CreateProfileRequest) ProtoMessage() {} +func (*CreateProfileRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{1} +} +func (m *CreateProfileRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateProfileRequest.Unmarshal(m, b) +} +func (m *CreateProfileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateProfileRequest.Marshal(b, m, deterministic) +} +func (dst *CreateProfileRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateProfileRequest.Merge(dst, src) +} +func (m *CreateProfileRequest) XXX_Size() int { + return xxx_messageInfo_CreateProfileRequest.Size(m) +} +func (m *CreateProfileRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateProfileRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateProfileRequest proto.InternalMessageInfo func (m *CreateProfileRequest) GetPayload() *Profile { if m != nil { @@ -132,13 +139,35 @@ func (m *CreateProfileRequest) GetPayload() *Profile { } type CreateProfileResponse struct { - Result *Profile `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + Result *Profile `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *CreateProfileResponse) Reset() { *m = CreateProfileResponse{} } -func (m *CreateProfileResponse) String() string { return proto.CompactTextString(m) } -func (*CreateProfileResponse) ProtoMessage() {} -func (*CreateProfileResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (m *CreateProfileResponse) Reset() { *m = CreateProfileResponse{} } +func (m *CreateProfileResponse) String() string { return proto.CompactTextString(m) } +func (*CreateProfileResponse) ProtoMessage() {} +func (*CreateProfileResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{2} +} +func (m *CreateProfileResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateProfileResponse.Unmarshal(m, b) +} +func (m *CreateProfileResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateProfileResponse.Marshal(b, m, deterministic) +} +func (dst *CreateProfileResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateProfileResponse.Merge(dst, src) +} +func (m *CreateProfileResponse) XXX_Size() int { + return xxx_messageInfo_CreateProfileResponse.Size(m) +} +func (m *CreateProfileResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CreateProfileResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateProfileResponse proto.InternalMessageInfo func (m *CreateProfileResponse) GetResult() *Profile { if m != nil { @@ -148,29 +177,73 @@ func (m *CreateProfileResponse) GetResult() *Profile { } type ReadProfileRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Id *resource.Identifier `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ReadProfileRequest) Reset() { *m = ReadProfileRequest{} } -func (m *ReadProfileRequest) String() string { return proto.CompactTextString(m) } -func (*ReadProfileRequest) ProtoMessage() {} -func (*ReadProfileRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } +func (m *ReadProfileRequest) Reset() { *m = ReadProfileRequest{} } +func (m *ReadProfileRequest) String() string { return proto.CompactTextString(m) } +func (*ReadProfileRequest) ProtoMessage() {} +func (*ReadProfileRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{3} +} +func (m *ReadProfileRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ReadProfileRequest.Unmarshal(m, b) +} +func (m *ReadProfileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ReadProfileRequest.Marshal(b, m, deterministic) +} +func (dst *ReadProfileRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadProfileRequest.Merge(dst, src) +} +func (m *ReadProfileRequest) XXX_Size() int { + return xxx_messageInfo_ReadProfileRequest.Size(m) +} +func (m *ReadProfileRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ReadProfileRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ReadProfileRequest proto.InternalMessageInfo -func (m *ReadProfileRequest) GetId() uint64 { +func (m *ReadProfileRequest) GetId() *resource.Identifier { if m != nil { return m.Id } - return 0 + return nil } type ReadProfileResponse struct { - Result *Profile `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + Result *Profile `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ReadProfileResponse) Reset() { *m = ReadProfileResponse{} } -func (m *ReadProfileResponse) String() string { return proto.CompactTextString(m) } -func (*ReadProfileResponse) ProtoMessage() {} -func (*ReadProfileResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } +func (m *ReadProfileResponse) Reset() { *m = ReadProfileResponse{} } +func (m *ReadProfileResponse) String() string { return proto.CompactTextString(m) } +func (*ReadProfileResponse) ProtoMessage() {} +func (*ReadProfileResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{4} +} +func (m *ReadProfileResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ReadProfileResponse.Unmarshal(m, b) +} +func (m *ReadProfileResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ReadProfileResponse.Marshal(b, m, deterministic) +} +func (dst *ReadProfileResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadProfileResponse.Merge(dst, src) +} +func (m *ReadProfileResponse) XXX_Size() int { + return xxx_messageInfo_ReadProfileResponse.Size(m) +} +func (m *ReadProfileResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ReadProfileResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ReadProfileResponse proto.InternalMessageInfo func (m *ReadProfileResponse) GetResult() *Profile { if m != nil { @@ -180,13 +253,35 @@ func (m *ReadProfileResponse) GetResult() *Profile { } type UpdateProfileRequest struct { - Payload *Profile `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + Payload *Profile `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateProfileRequest) Reset() { *m = UpdateProfileRequest{} } +func (m *UpdateProfileRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateProfileRequest) ProtoMessage() {} +func (*UpdateProfileRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{5} +} +func (m *UpdateProfileRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateProfileRequest.Unmarshal(m, b) +} +func (m *UpdateProfileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateProfileRequest.Marshal(b, m, deterministic) +} +func (dst *UpdateProfileRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateProfileRequest.Merge(dst, src) +} +func (m *UpdateProfileRequest) XXX_Size() int { + return xxx_messageInfo_UpdateProfileRequest.Size(m) +} +func (m *UpdateProfileRequest) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateProfileRequest.DiscardUnknown(m) } -func (m *UpdateProfileRequest) Reset() { *m = UpdateProfileRequest{} } -func (m *UpdateProfileRequest) String() string { return proto.CompactTextString(m) } -func (*UpdateProfileRequest) ProtoMessage() {} -func (*UpdateProfileRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } +var xxx_messageInfo_UpdateProfileRequest proto.InternalMessageInfo func (m *UpdateProfileRequest) GetPayload() *Profile { if m != nil { @@ -196,13 +291,35 @@ func (m *UpdateProfileRequest) GetPayload() *Profile { } type UpdateProfileResponse struct { - Result *Profile `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + Result *Profile `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *UpdateProfileResponse) Reset() { *m = UpdateProfileResponse{} } -func (m *UpdateProfileResponse) String() string { return proto.CompactTextString(m) } -func (*UpdateProfileResponse) ProtoMessage() {} -func (*UpdateProfileResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } +func (m *UpdateProfileResponse) Reset() { *m = UpdateProfileResponse{} } +func (m *UpdateProfileResponse) String() string { return proto.CompactTextString(m) } +func (*UpdateProfileResponse) ProtoMessage() {} +func (*UpdateProfileResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{6} +} +func (m *UpdateProfileResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateProfileResponse.Unmarshal(m, b) +} +func (m *UpdateProfileResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateProfileResponse.Marshal(b, m, deterministic) +} +func (dst *UpdateProfileResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateProfileResponse.Merge(dst, src) +} +func (m *UpdateProfileResponse) XXX_Size() int { + return xxx_messageInfo_UpdateProfileResponse.Size(m) +} +func (m *UpdateProfileResponse) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateProfileResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateProfileResponse proto.InternalMessageInfo func (m *UpdateProfileResponse) GetResult() *Profile { if m != nil { @@ -212,29 +329,73 @@ func (m *UpdateProfileResponse) GetResult() *Profile { } type DeleteProfileRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Id *resource.Identifier `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteProfileRequest) Reset() { *m = DeleteProfileRequest{} } +func (m *DeleteProfileRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteProfileRequest) ProtoMessage() {} +func (*DeleteProfileRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{7} +} +func (m *DeleteProfileRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteProfileRequest.Unmarshal(m, b) +} +func (m *DeleteProfileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteProfileRequest.Marshal(b, m, deterministic) +} +func (dst *DeleteProfileRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteProfileRequest.Merge(dst, src) +} +func (m *DeleteProfileRequest) XXX_Size() int { + return xxx_messageInfo_DeleteProfileRequest.Size(m) +} +func (m *DeleteProfileRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteProfileRequest.DiscardUnknown(m) } -func (m *DeleteProfileRequest) Reset() { *m = DeleteProfileRequest{} } -func (m *DeleteProfileRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteProfileRequest) ProtoMessage() {} -func (*DeleteProfileRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } +var xxx_messageInfo_DeleteProfileRequest proto.InternalMessageInfo -func (m *DeleteProfileRequest) GetId() uint64 { +func (m *DeleteProfileRequest) GetId() *resource.Identifier { if m != nil { return m.Id } - return 0 + return nil } type ListProfilesResponse struct { - Results []*Profile `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` + Results []*Profile `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListProfilesResponse) Reset() { *m = ListProfilesResponse{} } +func (m *ListProfilesResponse) String() string { return proto.CompactTextString(m) } +func (*ListProfilesResponse) ProtoMessage() {} +func (*ListProfilesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{8} +} +func (m *ListProfilesResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListProfilesResponse.Unmarshal(m, b) +} +func (m *ListProfilesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListProfilesResponse.Marshal(b, m, deterministic) +} +func (dst *ListProfilesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListProfilesResponse.Merge(dst, src) +} +func (m *ListProfilesResponse) XXX_Size() int { + return xxx_messageInfo_ListProfilesResponse.Size(m) +} +func (m *ListProfilesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListProfilesResponse.DiscardUnknown(m) } -func (m *ListProfilesResponse) Reset() { *m = ListProfilesResponse{} } -func (m *ListProfilesResponse) String() string { return proto.CompactTextString(m) } -func (*ListProfilesResponse) ProtoMessage() {} -func (*ListProfilesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } +var xxx_messageInfo_ListProfilesResponse proto.InternalMessageInfo func (m *ListProfilesResponse) GetResults() []*Profile { if m != nil { @@ -244,24 +405,46 @@ func (m *ListProfilesResponse) GetResults() []*Profile { } type Group struct { - Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Notes string `protobuf:"bytes,3,opt,name=notes" json:"notes,omitempty"` - Profile *Profile `protobuf:"bytes,4,opt,name=profile" json:"profile,omitempty"` - ProfileId uint64 `protobuf:"varint,5,opt,name=profile_id,json=profileId" json:"profile_id,omitempty"` - Contacts []*Contact `protobuf:"bytes,6,rep,name=contacts" json:"contacts,omitempty"` + Id *resource.Identifier `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Notes string `protobuf:"bytes,3,opt,name=notes" json:"notes,omitempty"` + Profile *Profile `protobuf:"bytes,4,opt,name=profile" json:"profile,omitempty"` + ProfileId *resource.Identifier `protobuf:"bytes,5,opt,name=profile_id,json=profileId" json:"profile_id,omitempty"` + Contacts []*Contact `protobuf:"bytes,6,rep,name=contacts" json:"contacts,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Group) Reset() { *m = Group{} } -func (m *Group) String() string { return proto.CompactTextString(m) } -func (*Group) ProtoMessage() {} -func (*Group) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } +func (m *Group) Reset() { *m = Group{} } +func (m *Group) String() string { return proto.CompactTextString(m) } +func (*Group) ProtoMessage() {} +func (*Group) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{9} +} +func (m *Group) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Group.Unmarshal(m, b) +} +func (m *Group) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Group.Marshal(b, m, deterministic) +} +func (dst *Group) XXX_Merge(src proto.Message) { + xxx_messageInfo_Group.Merge(dst, src) +} +func (m *Group) XXX_Size() int { + return xxx_messageInfo_Group.Size(m) +} +func (m *Group) XXX_DiscardUnknown() { + xxx_messageInfo_Group.DiscardUnknown(m) +} + +var xxx_messageInfo_Group proto.InternalMessageInfo -func (m *Group) GetId() uint64 { +func (m *Group) GetId() *resource.Identifier { if m != nil { return m.Id } - return 0 + return nil } func (m *Group) GetName() string { @@ -285,11 +468,11 @@ func (m *Group) GetProfile() *Profile { return nil } -func (m *Group) GetProfileId() uint64 { +func (m *Group) GetProfileId() *resource.Identifier { if m != nil { return m.ProfileId } - return 0 + return nil } func (m *Group) GetContacts() []*Contact { @@ -300,13 +483,35 @@ func (m *Group) GetContacts() []*Contact { } type CreateGroupRequest struct { - Payload *Group `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + Payload *Group `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateGroupRequest) Reset() { *m = CreateGroupRequest{} } +func (m *CreateGroupRequest) String() string { return proto.CompactTextString(m) } +func (*CreateGroupRequest) ProtoMessage() {} +func (*CreateGroupRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{10} +} +func (m *CreateGroupRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateGroupRequest.Unmarshal(m, b) +} +func (m *CreateGroupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateGroupRequest.Marshal(b, m, deterministic) +} +func (dst *CreateGroupRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateGroupRequest.Merge(dst, src) +} +func (m *CreateGroupRequest) XXX_Size() int { + return xxx_messageInfo_CreateGroupRequest.Size(m) +} +func (m *CreateGroupRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateGroupRequest.DiscardUnknown(m) } -func (m *CreateGroupRequest) Reset() { *m = CreateGroupRequest{} } -func (m *CreateGroupRequest) String() string { return proto.CompactTextString(m) } -func (*CreateGroupRequest) ProtoMessage() {} -func (*CreateGroupRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } +var xxx_messageInfo_CreateGroupRequest proto.InternalMessageInfo func (m *CreateGroupRequest) GetPayload() *Group { if m != nil { @@ -316,13 +521,35 @@ func (m *CreateGroupRequest) GetPayload() *Group { } type CreateGroupResponse struct { - Result *Group `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + Result *Group `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *CreateGroupResponse) Reset() { *m = CreateGroupResponse{} } -func (m *CreateGroupResponse) String() string { return proto.CompactTextString(m) } -func (*CreateGroupResponse) ProtoMessage() {} -func (*CreateGroupResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } +func (m *CreateGroupResponse) Reset() { *m = CreateGroupResponse{} } +func (m *CreateGroupResponse) String() string { return proto.CompactTextString(m) } +func (*CreateGroupResponse) ProtoMessage() {} +func (*CreateGroupResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{11} +} +func (m *CreateGroupResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateGroupResponse.Unmarshal(m, b) +} +func (m *CreateGroupResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateGroupResponse.Marshal(b, m, deterministic) +} +func (dst *CreateGroupResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateGroupResponse.Merge(dst, src) +} +func (m *CreateGroupResponse) XXX_Size() int { + return xxx_messageInfo_CreateGroupResponse.Size(m) +} +func (m *CreateGroupResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CreateGroupResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateGroupResponse proto.InternalMessageInfo func (m *CreateGroupResponse) GetResult() *Group { if m != nil { @@ -332,29 +559,73 @@ func (m *CreateGroupResponse) GetResult() *Group { } type ReadGroupRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Id *resource.Identifier `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ReadGroupRequest) Reset() { *m = ReadGroupRequest{} } -func (m *ReadGroupRequest) String() string { return proto.CompactTextString(m) } -func (*ReadGroupRequest) ProtoMessage() {} -func (*ReadGroupRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } +func (m *ReadGroupRequest) Reset() { *m = ReadGroupRequest{} } +func (m *ReadGroupRequest) String() string { return proto.CompactTextString(m) } +func (*ReadGroupRequest) ProtoMessage() {} +func (*ReadGroupRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{12} +} +func (m *ReadGroupRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ReadGroupRequest.Unmarshal(m, b) +} +func (m *ReadGroupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ReadGroupRequest.Marshal(b, m, deterministic) +} +func (dst *ReadGroupRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadGroupRequest.Merge(dst, src) +} +func (m *ReadGroupRequest) XXX_Size() int { + return xxx_messageInfo_ReadGroupRequest.Size(m) +} +func (m *ReadGroupRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ReadGroupRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ReadGroupRequest proto.InternalMessageInfo -func (m *ReadGroupRequest) GetId() uint64 { +func (m *ReadGroupRequest) GetId() *resource.Identifier { if m != nil { return m.Id } - return 0 + return nil } type ReadGroupResponse struct { - Result *Group `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + Result *Group `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ReadGroupResponse) Reset() { *m = ReadGroupResponse{} } +func (m *ReadGroupResponse) String() string { return proto.CompactTextString(m) } +func (*ReadGroupResponse) ProtoMessage() {} +func (*ReadGroupResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{13} +} +func (m *ReadGroupResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ReadGroupResponse.Unmarshal(m, b) +} +func (m *ReadGroupResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ReadGroupResponse.Marshal(b, m, deterministic) +} +func (dst *ReadGroupResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadGroupResponse.Merge(dst, src) +} +func (m *ReadGroupResponse) XXX_Size() int { + return xxx_messageInfo_ReadGroupResponse.Size(m) +} +func (m *ReadGroupResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ReadGroupResponse.DiscardUnknown(m) } -func (m *ReadGroupResponse) Reset() { *m = ReadGroupResponse{} } -func (m *ReadGroupResponse) String() string { return proto.CompactTextString(m) } -func (*ReadGroupResponse) ProtoMessage() {} -func (*ReadGroupResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } +var xxx_messageInfo_ReadGroupResponse proto.InternalMessageInfo func (m *ReadGroupResponse) GetResult() *Group { if m != nil { @@ -364,13 +635,35 @@ func (m *ReadGroupResponse) GetResult() *Group { } type UpdateGroupRequest struct { - Payload *Group `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + Payload *Group `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateGroupRequest) Reset() { *m = UpdateGroupRequest{} } +func (m *UpdateGroupRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateGroupRequest) ProtoMessage() {} +func (*UpdateGroupRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{14} +} +func (m *UpdateGroupRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateGroupRequest.Unmarshal(m, b) +} +func (m *UpdateGroupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateGroupRequest.Marshal(b, m, deterministic) +} +func (dst *UpdateGroupRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateGroupRequest.Merge(dst, src) +} +func (m *UpdateGroupRequest) XXX_Size() int { + return xxx_messageInfo_UpdateGroupRequest.Size(m) +} +func (m *UpdateGroupRequest) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateGroupRequest.DiscardUnknown(m) } -func (m *UpdateGroupRequest) Reset() { *m = UpdateGroupRequest{} } -func (m *UpdateGroupRequest) String() string { return proto.CompactTextString(m) } -func (*UpdateGroupRequest) ProtoMessage() {} -func (*UpdateGroupRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } +var xxx_messageInfo_UpdateGroupRequest proto.InternalMessageInfo func (m *UpdateGroupRequest) GetPayload() *Group { if m != nil { @@ -380,13 +673,35 @@ func (m *UpdateGroupRequest) GetPayload() *Group { } type UpdateGroupResponse struct { - Result *Group `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + Result *Group `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *UpdateGroupResponse) Reset() { *m = UpdateGroupResponse{} } -func (m *UpdateGroupResponse) String() string { return proto.CompactTextString(m) } -func (*UpdateGroupResponse) ProtoMessage() {} -func (*UpdateGroupResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } +func (m *UpdateGroupResponse) Reset() { *m = UpdateGroupResponse{} } +func (m *UpdateGroupResponse) String() string { return proto.CompactTextString(m) } +func (*UpdateGroupResponse) ProtoMessage() {} +func (*UpdateGroupResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{15} +} +func (m *UpdateGroupResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateGroupResponse.Unmarshal(m, b) +} +func (m *UpdateGroupResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateGroupResponse.Marshal(b, m, deterministic) +} +func (dst *UpdateGroupResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateGroupResponse.Merge(dst, src) +} +func (m *UpdateGroupResponse) XXX_Size() int { + return xxx_messageInfo_UpdateGroupResponse.Size(m) +} +func (m *UpdateGroupResponse) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateGroupResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateGroupResponse proto.InternalMessageInfo func (m *UpdateGroupResponse) GetResult() *Group { if m != nil { @@ -396,29 +711,73 @@ func (m *UpdateGroupResponse) GetResult() *Group { } type DeleteGroupRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Id *resource.Identifier `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteGroupRequest) Reset() { *m = DeleteGroupRequest{} } +func (m *DeleteGroupRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteGroupRequest) ProtoMessage() {} +func (*DeleteGroupRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{16} +} +func (m *DeleteGroupRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteGroupRequest.Unmarshal(m, b) +} +func (m *DeleteGroupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteGroupRequest.Marshal(b, m, deterministic) +} +func (dst *DeleteGroupRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteGroupRequest.Merge(dst, src) +} +func (m *DeleteGroupRequest) XXX_Size() int { + return xxx_messageInfo_DeleteGroupRequest.Size(m) +} +func (m *DeleteGroupRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteGroupRequest.DiscardUnknown(m) } -func (m *DeleteGroupRequest) Reset() { *m = DeleteGroupRequest{} } -func (m *DeleteGroupRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteGroupRequest) ProtoMessage() {} -func (*DeleteGroupRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } +var xxx_messageInfo_DeleteGroupRequest proto.InternalMessageInfo -func (m *DeleteGroupRequest) GetId() uint64 { +func (m *DeleteGroupRequest) GetId() *resource.Identifier { if m != nil { return m.Id } - return 0 + return nil } type ListGroupsResponse struct { - Results []*Group `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` + Results []*Group `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ListGroupsResponse) Reset() { *m = ListGroupsResponse{} } -func (m *ListGroupsResponse) String() string { return proto.CompactTextString(m) } -func (*ListGroupsResponse) ProtoMessage() {} -func (*ListGroupsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } +func (m *ListGroupsResponse) Reset() { *m = ListGroupsResponse{} } +func (m *ListGroupsResponse) String() string { return proto.CompactTextString(m) } +func (*ListGroupsResponse) ProtoMessage() {} +func (*ListGroupsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{17} +} +func (m *ListGroupsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListGroupsResponse.Unmarshal(m, b) +} +func (m *ListGroupsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListGroupsResponse.Marshal(b, m, deterministic) +} +func (dst *ListGroupsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListGroupsResponse.Merge(dst, src) +} +func (m *ListGroupsResponse) XXX_Size() int { + return xxx_messageInfo_ListGroupsResponse.Size(m) +} +func (m *ListGroupsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListGroupsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListGroupsResponse proto.InternalMessageInfo func (m *ListGroupsResponse) GetResults() []*Group { if m != nil { @@ -428,32 +787,54 @@ func (m *ListGroupsResponse) GetResults() []*Group { } type Contact struct { - Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - FirstName string `protobuf:"bytes,2,opt,name=first_name,json=firstName" json:"first_name,omitempty"` - MiddleName string `protobuf:"bytes,3,opt,name=middle_name,json=middleName" json:"middle_name,omitempty"` - LastName string `protobuf:"bytes,4,opt,name=last_name,json=lastName" json:"last_name,omitempty"` - PrimaryEmail string `protobuf:"bytes,6,opt,name=primary_email,json=primaryEmail" json:"primary_email,omitempty"` - Notes string `protobuf:"bytes,7,opt,name=notes" json:"notes,omitempty"` - Emails []*Email `protobuf:"bytes,8,rep,name=emails" json:"emails,omitempty"` - HomeAddress *Address `protobuf:"bytes,9,opt,name=home_address,json=homeAddress" json:"home_address,omitempty"` - WorkAddress *Address `protobuf:"bytes,10,opt,name=work_address,json=workAddress" json:"work_address,omitempty"` - ProfileId uint64 `protobuf:"varint,11,opt,name=profile_id,json=profileId" json:"profile_id,omitempty"` - Profile *Profile `protobuf:"bytes,12,opt,name=profile" json:"profile,omitempty"` - Groups []*Group `protobuf:"bytes,13,rep,name=groups" json:"groups,omitempty"` + Id *resource.Identifier `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + FirstName string `protobuf:"bytes,2,opt,name=first_name,json=firstName" json:"first_name,omitempty"` + MiddleName string `protobuf:"bytes,3,opt,name=middle_name,json=middleName" json:"middle_name,omitempty"` + LastName string `protobuf:"bytes,4,opt,name=last_name,json=lastName" json:"last_name,omitempty"` + PrimaryEmail string `protobuf:"bytes,6,opt,name=primary_email,json=primaryEmail" json:"primary_email,omitempty"` + Notes string `protobuf:"bytes,7,opt,name=notes" json:"notes,omitempty"` + Emails []*Email `protobuf:"bytes,8,rep,name=emails" json:"emails,omitempty"` + HomeAddress *Address `protobuf:"bytes,9,opt,name=home_address,json=homeAddress" json:"home_address,omitempty"` + WorkAddress *Address `protobuf:"bytes,10,opt,name=work_address,json=workAddress" json:"work_address,omitempty"` + ProfileId *resource.Identifier `protobuf:"bytes,11,opt,name=profile_id,json=profileId" json:"profile_id,omitempty"` + Profile *Profile `protobuf:"bytes,12,opt,name=profile" json:"profile,omitempty"` + Groups []*Group `protobuf:"bytes,13,rep,name=groups" json:"groups,omitempty"` // nicknames is arbitrary json, but should be used for a list of strings - Nicknames *gorm_types.JSONValue `protobuf:"bytes,14,opt,name=nicknames" json:"nicknames,omitempty"` + Nicknames *types.JSONValue `protobuf:"bytes,14,opt,name=nicknames" json:"nicknames,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Contact) Reset() { *m = Contact{} } -func (m *Contact) String() string { return proto.CompactTextString(m) } -func (*Contact) ProtoMessage() {} -func (*Contact) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } +func (m *Contact) Reset() { *m = Contact{} } +func (m *Contact) String() string { return proto.CompactTextString(m) } +func (*Contact) ProtoMessage() {} +func (*Contact) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{18} +} +func (m *Contact) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Contact.Unmarshal(m, b) +} +func (m *Contact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Contact.Marshal(b, m, deterministic) +} +func (dst *Contact) XXX_Merge(src proto.Message) { + xxx_messageInfo_Contact.Merge(dst, src) +} +func (m *Contact) XXX_Size() int { + return xxx_messageInfo_Contact.Size(m) +} +func (m *Contact) XXX_DiscardUnknown() { + xxx_messageInfo_Contact.DiscardUnknown(m) +} + +var xxx_messageInfo_Contact proto.InternalMessageInfo -func (m *Contact) GetId() uint64 { +func (m *Contact) GetId() *resource.Identifier { if m != nil { return m.Id } - return 0 + return nil } func (m *Contact) GetFirstName() string { @@ -512,11 +893,11 @@ func (m *Contact) GetWorkAddress() *Address { return nil } -func (m *Contact) GetProfileId() uint64 { +func (m *Contact) GetProfileId() *resource.Identifier { if m != nil { return m.ProfileId } - return 0 + return nil } func (m *Contact) GetProfile() *Profile { @@ -533,7 +914,7 @@ func (m *Contact) GetGroups() []*Group { return nil } -func (m *Contact) GetNicknames() *gorm_types.JSONValue { +func (m *Contact) GetNicknames() *types.JSONValue { if m != nil { return m.Nicknames } @@ -541,14 +922,36 @@ func (m *Contact) GetNicknames() *gorm_types.JSONValue { } type Email struct { - Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Email) Reset() { *m = Email{} } -func (m *Email) String() string { return proto.CompactTextString(m) } -func (*Email) ProtoMessage() {} -func (*Email) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } +func (m *Email) Reset() { *m = Email{} } +func (m *Email) String() string { return proto.CompactTextString(m) } +func (*Email) ProtoMessage() {} +func (*Email) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{19} +} +func (m *Email) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Email.Unmarshal(m, b) +} +func (m *Email) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Email.Marshal(b, m, deterministic) +} +func (dst *Email) XXX_Merge(src proto.Message) { + xxx_messageInfo_Email.Merge(dst, src) +} +func (m *Email) XXX_Size() int { + return xxx_messageInfo_Email.Size(m) +} +func (m *Email) XXX_DiscardUnknown() { + xxx_messageInfo_Email.DiscardUnknown(m) +} + +var xxx_messageInfo_Email proto.InternalMessageInfo func (m *Email) GetId() uint64 { if m != nil { @@ -565,17 +968,39 @@ func (m *Email) GetAddress() string { } type Address struct { - Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` - City string `protobuf:"bytes,2,opt,name=city" json:"city,omitempty"` - State string `protobuf:"bytes,3,opt,name=state" json:"state,omitempty"` - Zip string `protobuf:"bytes,4,opt,name=zip" json:"zip,omitempty"` - Country string `protobuf:"bytes,5,opt,name=country" json:"country,omitempty"` + Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + City string `protobuf:"bytes,2,opt,name=city" json:"city,omitempty"` + State string `protobuf:"bytes,3,opt,name=state" json:"state,omitempty"` + Zip string `protobuf:"bytes,4,opt,name=zip" json:"zip,omitempty"` + Country string `protobuf:"bytes,5,opt,name=country" json:"country,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Address) Reset() { *m = Address{} } +func (m *Address) String() string { return proto.CompactTextString(m) } +func (*Address) ProtoMessage() {} +func (*Address) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{20} +} +func (m *Address) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Address.Unmarshal(m, b) +} +func (m *Address) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Address.Marshal(b, m, deterministic) +} +func (dst *Address) XXX_Merge(src proto.Message) { + xxx_messageInfo_Address.Merge(dst, src) +} +func (m *Address) XXX_Size() int { + return xxx_messageInfo_Address.Size(m) +} +func (m *Address) XXX_DiscardUnknown() { + xxx_messageInfo_Address.DiscardUnknown(m) } -func (m *Address) Reset() { *m = Address{} } -func (m *Address) String() string { return proto.CompactTextString(m) } -func (*Address) ProtoMessage() {} -func (*Address) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } +var xxx_messageInfo_Address proto.InternalMessageInfo func (m *Address) GetAddress() string { if m != nil { @@ -613,13 +1038,35 @@ func (m *Address) GetCountry() string { } type CreateContactRequest struct { - Payload *Contact `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + Payload *Contact `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *CreateContactRequest) Reset() { *m = CreateContactRequest{} } -func (m *CreateContactRequest) String() string { return proto.CompactTextString(m) } -func (*CreateContactRequest) ProtoMessage() {} -func (*CreateContactRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } +func (m *CreateContactRequest) Reset() { *m = CreateContactRequest{} } +func (m *CreateContactRequest) String() string { return proto.CompactTextString(m) } +func (*CreateContactRequest) ProtoMessage() {} +func (*CreateContactRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{21} +} +func (m *CreateContactRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateContactRequest.Unmarshal(m, b) +} +func (m *CreateContactRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateContactRequest.Marshal(b, m, deterministic) +} +func (dst *CreateContactRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateContactRequest.Merge(dst, src) +} +func (m *CreateContactRequest) XXX_Size() int { + return xxx_messageInfo_CreateContactRequest.Size(m) +} +func (m *CreateContactRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateContactRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateContactRequest proto.InternalMessageInfo func (m *CreateContactRequest) GetPayload() *Contact { if m != nil { @@ -629,13 +1076,35 @@ func (m *CreateContactRequest) GetPayload() *Contact { } type CreateContactResponse struct { - Result *Contact `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + Result *Contact `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *CreateContactResponse) Reset() { *m = CreateContactResponse{} } -func (m *CreateContactResponse) String() string { return proto.CompactTextString(m) } -func (*CreateContactResponse) ProtoMessage() {} -func (*CreateContactResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } +func (m *CreateContactResponse) Reset() { *m = CreateContactResponse{} } +func (m *CreateContactResponse) String() string { return proto.CompactTextString(m) } +func (*CreateContactResponse) ProtoMessage() {} +func (*CreateContactResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{22} +} +func (m *CreateContactResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateContactResponse.Unmarshal(m, b) +} +func (m *CreateContactResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateContactResponse.Marshal(b, m, deterministic) +} +func (dst *CreateContactResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateContactResponse.Merge(dst, src) +} +func (m *CreateContactResponse) XXX_Size() int { + return xxx_messageInfo_CreateContactResponse.Size(m) +} +func (m *CreateContactResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CreateContactResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateContactResponse proto.InternalMessageInfo func (m *CreateContactResponse) GetResult() *Contact { if m != nil { @@ -645,29 +1114,73 @@ func (m *CreateContactResponse) GetResult() *Contact { } type ReadContactRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Id *resource.Identifier `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ReadContactRequest) Reset() { *m = ReadContactRequest{} } +func (m *ReadContactRequest) String() string { return proto.CompactTextString(m) } +func (*ReadContactRequest) ProtoMessage() {} +func (*ReadContactRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{23} +} +func (m *ReadContactRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ReadContactRequest.Unmarshal(m, b) +} +func (m *ReadContactRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ReadContactRequest.Marshal(b, m, deterministic) +} +func (dst *ReadContactRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadContactRequest.Merge(dst, src) +} +func (m *ReadContactRequest) XXX_Size() int { + return xxx_messageInfo_ReadContactRequest.Size(m) +} +func (m *ReadContactRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ReadContactRequest.DiscardUnknown(m) } -func (m *ReadContactRequest) Reset() { *m = ReadContactRequest{} } -func (m *ReadContactRequest) String() string { return proto.CompactTextString(m) } -func (*ReadContactRequest) ProtoMessage() {} -func (*ReadContactRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } +var xxx_messageInfo_ReadContactRequest proto.InternalMessageInfo -func (m *ReadContactRequest) GetId() uint64 { +func (m *ReadContactRequest) GetId() *resource.Identifier { if m != nil { return m.Id } - return 0 + return nil } type ReadContactResponse struct { - Result *Contact `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + Result *Contact `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ReadContactResponse) Reset() { *m = ReadContactResponse{} } +func (m *ReadContactResponse) String() string { return proto.CompactTextString(m) } +func (*ReadContactResponse) ProtoMessage() {} +func (*ReadContactResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{24} +} +func (m *ReadContactResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ReadContactResponse.Unmarshal(m, b) +} +func (m *ReadContactResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ReadContactResponse.Marshal(b, m, deterministic) +} +func (dst *ReadContactResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadContactResponse.Merge(dst, src) +} +func (m *ReadContactResponse) XXX_Size() int { + return xxx_messageInfo_ReadContactResponse.Size(m) +} +func (m *ReadContactResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ReadContactResponse.DiscardUnknown(m) } -func (m *ReadContactResponse) Reset() { *m = ReadContactResponse{} } -func (m *ReadContactResponse) String() string { return proto.CompactTextString(m) } -func (*ReadContactResponse) ProtoMessage() {} -func (*ReadContactResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } +var xxx_messageInfo_ReadContactResponse proto.InternalMessageInfo func (m *ReadContactResponse) GetResult() *Contact { if m != nil { @@ -677,13 +1190,35 @@ func (m *ReadContactResponse) GetResult() *Contact { } type UpdateContactRequest struct { - Payload *Contact `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + Payload *Contact `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *UpdateContactRequest) Reset() { *m = UpdateContactRequest{} } -func (m *UpdateContactRequest) String() string { return proto.CompactTextString(m) } -func (*UpdateContactRequest) ProtoMessage() {} -func (*UpdateContactRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } +func (m *UpdateContactRequest) Reset() { *m = UpdateContactRequest{} } +func (m *UpdateContactRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateContactRequest) ProtoMessage() {} +func (*UpdateContactRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{25} +} +func (m *UpdateContactRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateContactRequest.Unmarshal(m, b) +} +func (m *UpdateContactRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateContactRequest.Marshal(b, m, deterministic) +} +func (dst *UpdateContactRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateContactRequest.Merge(dst, src) +} +func (m *UpdateContactRequest) XXX_Size() int { + return xxx_messageInfo_UpdateContactRequest.Size(m) +} +func (m *UpdateContactRequest) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateContactRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateContactRequest proto.InternalMessageInfo func (m *UpdateContactRequest) GetPayload() *Contact { if m != nil { @@ -693,13 +1228,35 @@ func (m *UpdateContactRequest) GetPayload() *Contact { } type UpdateContactResponse struct { - Result *Contact `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + Result *Contact `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateContactResponse) Reset() { *m = UpdateContactResponse{} } +func (m *UpdateContactResponse) String() string { return proto.CompactTextString(m) } +func (*UpdateContactResponse) ProtoMessage() {} +func (*UpdateContactResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{26} +} +func (m *UpdateContactResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateContactResponse.Unmarshal(m, b) +} +func (m *UpdateContactResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateContactResponse.Marshal(b, m, deterministic) +} +func (dst *UpdateContactResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateContactResponse.Merge(dst, src) +} +func (m *UpdateContactResponse) XXX_Size() int { + return xxx_messageInfo_UpdateContactResponse.Size(m) +} +func (m *UpdateContactResponse) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateContactResponse.DiscardUnknown(m) } -func (m *UpdateContactResponse) Reset() { *m = UpdateContactResponse{} } -func (m *UpdateContactResponse) String() string { return proto.CompactTextString(m) } -func (*UpdateContactResponse) ProtoMessage() {} -func (*UpdateContactResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } +var xxx_messageInfo_UpdateContactResponse proto.InternalMessageInfo func (m *UpdateContactResponse) GetResult() *Contact { if m != nil { @@ -709,29 +1266,73 @@ func (m *UpdateContactResponse) GetResult() *Contact { } type DeleteContactRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Id *resource.Identifier `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteContactRequest) Reset() { *m = DeleteContactRequest{} } +func (m *DeleteContactRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteContactRequest) ProtoMessage() {} +func (*DeleteContactRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{27} +} +func (m *DeleteContactRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteContactRequest.Unmarshal(m, b) +} +func (m *DeleteContactRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteContactRequest.Marshal(b, m, deterministic) +} +func (dst *DeleteContactRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteContactRequest.Merge(dst, src) +} +func (m *DeleteContactRequest) XXX_Size() int { + return xxx_messageInfo_DeleteContactRequest.Size(m) +} +func (m *DeleteContactRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteContactRequest.DiscardUnknown(m) } -func (m *DeleteContactRequest) Reset() { *m = DeleteContactRequest{} } -func (m *DeleteContactRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteContactRequest) ProtoMessage() {} -func (*DeleteContactRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } +var xxx_messageInfo_DeleteContactRequest proto.InternalMessageInfo -func (m *DeleteContactRequest) GetId() uint64 { +func (m *DeleteContactRequest) GetId() *resource.Identifier { if m != nil { return m.Id } - return 0 + return nil } type ListContactsResponse struct { - Results []*Contact `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` + Results []*Contact `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListContactsResponse) Reset() { *m = ListContactsResponse{} } +func (m *ListContactsResponse) String() string { return proto.CompactTextString(m) } +func (*ListContactsResponse) ProtoMessage() {} +func (*ListContactsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{28} +} +func (m *ListContactsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListContactsResponse.Unmarshal(m, b) +} +func (m *ListContactsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListContactsResponse.Marshal(b, m, deterministic) +} +func (dst *ListContactsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListContactsResponse.Merge(dst, src) +} +func (m *ListContactsResponse) XXX_Size() int { + return xxx_messageInfo_ListContactsResponse.Size(m) +} +func (m *ListContactsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListContactsResponse.DiscardUnknown(m) } -func (m *ListContactsResponse) Reset() { *m = ListContactsResponse{} } -func (m *ListContactsResponse) String() string { return proto.CompactTextString(m) } -func (*ListContactsResponse) ProtoMessage() {} -func (*ListContactsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } +var xxx_messageInfo_ListContactsResponse proto.InternalMessageInfo func (m *ListContactsResponse) GetResults() []*Contact { if m != nil { @@ -741,14 +1342,36 @@ func (m *ListContactsResponse) GetResults() []*Contact { } type SMSRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *SMSRequest) Reset() { *m = SMSRequest{} } -func (m *SMSRequest) String() string { return proto.CompactTextString(m) } -func (*SMSRequest) ProtoMessage() {} -func (*SMSRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} } +func (m *SMSRequest) Reset() { *m = SMSRequest{} } +func (m *SMSRequest) String() string { return proto.CompactTextString(m) } +func (*SMSRequest) ProtoMessage() {} +func (*SMSRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_contacts_579b8531e4c20cb3, []int{29} +} +func (m *SMSRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SMSRequest.Unmarshal(m, b) +} +func (m *SMSRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SMSRequest.Marshal(b, m, deterministic) +} +func (dst *SMSRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SMSRequest.Merge(dst, src) +} +func (m *SMSRequest) XXX_Size() int { + return xxx_messageInfo_SMSRequest.Size(m) +} +func (m *SMSRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SMSRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SMSRequest proto.InternalMessageInfo func (m *SMSRequest) GetId() uint64 { if m != nil { @@ -805,14 +1428,15 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// Client API for Profiles service - +// ProfilesClient is the client API for Profiles service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type ProfilesClient interface { Create(ctx context.Context, in *CreateProfileRequest, opts ...grpc.CallOption) (*CreateProfileResponse, error) Read(ctx context.Context, in *ReadProfileRequest, opts ...grpc.CallOption) (*ReadProfileResponse, error) Update(ctx context.Context, in *UpdateProfileRequest, opts ...grpc.CallOption) (*UpdateProfileResponse, error) - Delete(ctx context.Context, in *DeleteProfileRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) - List(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*ListProfilesResponse, error) + Delete(ctx context.Context, in *DeleteProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error) + List(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListProfilesResponse, error) } type profilesClient struct { @@ -825,7 +1449,7 @@ func NewProfilesClient(cc *grpc.ClientConn) ProfilesClient { func (c *profilesClient) Create(ctx context.Context, in *CreateProfileRequest, opts ...grpc.CallOption) (*CreateProfileResponse, error) { out := new(CreateProfileResponse) - err := grpc.Invoke(ctx, "/api.contacts.Profiles/Create", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/api.contacts.Profiles/Create", in, out, opts...) if err != nil { return nil, err } @@ -834,7 +1458,7 @@ func (c *profilesClient) Create(ctx context.Context, in *CreateProfileRequest, o func (c *profilesClient) Read(ctx context.Context, in *ReadProfileRequest, opts ...grpc.CallOption) (*ReadProfileResponse, error) { out := new(ReadProfileResponse) - err := grpc.Invoke(ctx, "/api.contacts.Profiles/Read", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/api.contacts.Profiles/Read", in, out, opts...) if err != nil { return nil, err } @@ -843,25 +1467,25 @@ func (c *profilesClient) Read(ctx context.Context, in *ReadProfileRequest, opts func (c *profilesClient) Update(ctx context.Context, in *UpdateProfileRequest, opts ...grpc.CallOption) (*UpdateProfileResponse, error) { out := new(UpdateProfileResponse) - err := grpc.Invoke(ctx, "/api.contacts.Profiles/Update", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/api.contacts.Profiles/Update", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *profilesClient) Delete(ctx context.Context, in *DeleteProfileRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { - out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/api.contacts.Profiles/Delete", in, out, c.cc, opts...) +func (c *profilesClient) Delete(ctx context.Context, in *DeleteProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/api.contacts.Profiles/Delete", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *profilesClient) List(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*ListProfilesResponse, error) { +func (c *profilesClient) List(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListProfilesResponse, error) { out := new(ListProfilesResponse) - err := grpc.Invoke(ctx, "/api.contacts.Profiles/List", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/api.contacts.Profiles/List", in, out, opts...) if err != nil { return nil, err } @@ -874,8 +1498,8 @@ type ProfilesServer interface { Create(context.Context, *CreateProfileRequest) (*CreateProfileResponse, error) Read(context.Context, *ReadProfileRequest) (*ReadProfileResponse, error) Update(context.Context, *UpdateProfileRequest) (*UpdateProfileResponse, error) - Delete(context.Context, *DeleteProfileRequest) (*google_protobuf.Empty, error) - List(context.Context, *google_protobuf.Empty) (*ListProfilesResponse, error) + Delete(context.Context, *DeleteProfileRequest) (*empty.Empty, error) + List(context.Context, *empty.Empty) (*ListProfilesResponse, error) } func RegisterProfilesServer(s *grpc.Server, srv ProfilesServer) { @@ -955,7 +1579,7 @@ func _Profiles_Delete_Handler(srv interface{}, ctx context.Context, dec func(int } func _Profiles_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(google_protobuf.Empty) + in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } @@ -967,7 +1591,7 @@ func _Profiles_List_Handler(srv interface{}, ctx context.Context, dec func(inter FullMethod: "/api.contacts.Profiles/List", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProfilesServer).List(ctx, req.(*google_protobuf.Empty)) + return srv.(ProfilesServer).List(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } @@ -998,17 +1622,18 @@ var _Profiles_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "github.com/infobloxopen/atlas-contacts-app/pkg/pb/contacts.proto", + Metadata: "pkg/pb/contacts.proto", } -// Client API for Groups service - +// GroupsClient is the client API for Groups service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type GroupsClient interface { Create(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*CreateGroupResponse, error) Read(ctx context.Context, in *ReadGroupRequest, opts ...grpc.CallOption) (*ReadGroupResponse, error) Update(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*UpdateGroupResponse, error) - Delete(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) - List(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*ListGroupsResponse, error) + Delete(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error) + List(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListGroupsResponse, error) } type groupsClient struct { @@ -1021,7 +1646,7 @@ func NewGroupsClient(cc *grpc.ClientConn) GroupsClient { func (c *groupsClient) Create(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*CreateGroupResponse, error) { out := new(CreateGroupResponse) - err := grpc.Invoke(ctx, "/api.contacts.Groups/Create", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/api.contacts.Groups/Create", in, out, opts...) if err != nil { return nil, err } @@ -1030,7 +1655,7 @@ func (c *groupsClient) Create(ctx context.Context, in *CreateGroupRequest, opts func (c *groupsClient) Read(ctx context.Context, in *ReadGroupRequest, opts ...grpc.CallOption) (*ReadGroupResponse, error) { out := new(ReadGroupResponse) - err := grpc.Invoke(ctx, "/api.contacts.Groups/Read", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/api.contacts.Groups/Read", in, out, opts...) if err != nil { return nil, err } @@ -1039,25 +1664,25 @@ func (c *groupsClient) Read(ctx context.Context, in *ReadGroupRequest, opts ...g func (c *groupsClient) Update(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*UpdateGroupResponse, error) { out := new(UpdateGroupResponse) - err := grpc.Invoke(ctx, "/api.contacts.Groups/Update", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/api.contacts.Groups/Update", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *groupsClient) Delete(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { - out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/api.contacts.Groups/Delete", in, out, c.cc, opts...) +func (c *groupsClient) Delete(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/api.contacts.Groups/Delete", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *groupsClient) List(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*ListGroupsResponse, error) { +func (c *groupsClient) List(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListGroupsResponse, error) { out := new(ListGroupsResponse) - err := grpc.Invoke(ctx, "/api.contacts.Groups/List", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/api.contacts.Groups/List", in, out, opts...) if err != nil { return nil, err } @@ -1070,8 +1695,8 @@ type GroupsServer interface { Create(context.Context, *CreateGroupRequest) (*CreateGroupResponse, error) Read(context.Context, *ReadGroupRequest) (*ReadGroupResponse, error) Update(context.Context, *UpdateGroupRequest) (*UpdateGroupResponse, error) - Delete(context.Context, *DeleteGroupRequest) (*google_protobuf.Empty, error) - List(context.Context, *google_protobuf.Empty) (*ListGroupsResponse, error) + Delete(context.Context, *DeleteGroupRequest) (*empty.Empty, error) + List(context.Context, *empty.Empty) (*ListGroupsResponse, error) } func RegisterGroupsServer(s *grpc.Server, srv GroupsServer) { @@ -1151,7 +1776,7 @@ func _Groups_Delete_Handler(srv interface{}, ctx context.Context, dec func(inter } func _Groups_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(google_protobuf.Empty) + in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } @@ -1163,7 +1788,7 @@ func _Groups_List_Handler(srv interface{}, ctx context.Context, dec func(interfa FullMethod: "/api.contacts.Groups/List", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupsServer).List(ctx, req.(*google_protobuf.Empty)) + return srv.(GroupsServer).List(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } @@ -1194,18 +1819,19 @@ var _Groups_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "github.com/infobloxopen/atlas-contacts-app/pkg/pb/contacts.proto", + Metadata: "pkg/pb/contacts.proto", } -// Client API for Contacts service - +// ContactsClient is the client API for Contacts service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type ContactsClient interface { Create(ctx context.Context, in *CreateContactRequest, opts ...grpc.CallOption) (*CreateContactResponse, error) Read(ctx context.Context, in *ReadContactRequest, opts ...grpc.CallOption) (*ReadContactResponse, error) Update(ctx context.Context, in *UpdateContactRequest, opts ...grpc.CallOption) (*UpdateContactResponse, error) - Delete(ctx context.Context, in *DeleteContactRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) - List(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*ListContactsResponse, error) - SendSMS(ctx context.Context, in *SMSRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) + Delete(ctx context.Context, in *DeleteContactRequest, opts ...grpc.CallOption) (*empty.Empty, error) + List(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListContactsResponse, error) + SendSMS(ctx context.Context, in *SMSRequest, opts ...grpc.CallOption) (*empty.Empty, error) } type contactsClient struct { @@ -1218,7 +1844,7 @@ func NewContactsClient(cc *grpc.ClientConn) ContactsClient { func (c *contactsClient) Create(ctx context.Context, in *CreateContactRequest, opts ...grpc.CallOption) (*CreateContactResponse, error) { out := new(CreateContactResponse) - err := grpc.Invoke(ctx, "/api.contacts.Contacts/Create", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/api.contacts.Contacts/Create", in, out, opts...) if err != nil { return nil, err } @@ -1227,7 +1853,7 @@ func (c *contactsClient) Create(ctx context.Context, in *CreateContactRequest, o func (c *contactsClient) Read(ctx context.Context, in *ReadContactRequest, opts ...grpc.CallOption) (*ReadContactResponse, error) { out := new(ReadContactResponse) - err := grpc.Invoke(ctx, "/api.contacts.Contacts/Read", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/api.contacts.Contacts/Read", in, out, opts...) if err != nil { return nil, err } @@ -1236,34 +1862,34 @@ func (c *contactsClient) Read(ctx context.Context, in *ReadContactRequest, opts func (c *contactsClient) Update(ctx context.Context, in *UpdateContactRequest, opts ...grpc.CallOption) (*UpdateContactResponse, error) { out := new(UpdateContactResponse) - err := grpc.Invoke(ctx, "/api.contacts.Contacts/Update", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/api.contacts.Contacts/Update", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *contactsClient) Delete(ctx context.Context, in *DeleteContactRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { - out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/api.contacts.Contacts/Delete", in, out, c.cc, opts...) +func (c *contactsClient) Delete(ctx context.Context, in *DeleteContactRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/api.contacts.Contacts/Delete", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *contactsClient) List(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*ListContactsResponse, error) { +func (c *contactsClient) List(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListContactsResponse, error) { out := new(ListContactsResponse) - err := grpc.Invoke(ctx, "/api.contacts.Contacts/List", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/api.contacts.Contacts/List", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *contactsClient) SendSMS(ctx context.Context, in *SMSRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { - out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/api.contacts.Contacts/SendSMS", in, out, c.cc, opts...) +func (c *contactsClient) SendSMS(ctx context.Context, in *SMSRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/api.contacts.Contacts/SendSMS", in, out, opts...) if err != nil { return nil, err } @@ -1276,9 +1902,9 @@ type ContactsServer interface { Create(context.Context, *CreateContactRequest) (*CreateContactResponse, error) Read(context.Context, *ReadContactRequest) (*ReadContactResponse, error) Update(context.Context, *UpdateContactRequest) (*UpdateContactResponse, error) - Delete(context.Context, *DeleteContactRequest) (*google_protobuf.Empty, error) - List(context.Context, *google_protobuf.Empty) (*ListContactsResponse, error) - SendSMS(context.Context, *SMSRequest) (*google_protobuf.Empty, error) + Delete(context.Context, *DeleteContactRequest) (*empty.Empty, error) + List(context.Context, *empty.Empty) (*ListContactsResponse, error) + SendSMS(context.Context, *SMSRequest) (*empty.Empty, error) } func RegisterContactsServer(s *grpc.Server, srv ContactsServer) { @@ -1358,7 +1984,7 @@ func _Contacts_Delete_Handler(srv interface{}, ctx context.Context, dec func(int } func _Contacts_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(google_protobuf.Empty) + in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } @@ -1370,7 +1996,7 @@ func _Contacts_List_Handler(srv interface{}, ctx context.Context, dec func(inter FullMethod: "/api.contacts.Contacts/List", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContactsServer).List(ctx, req.(*google_protobuf.Empty)) + return srv.(ContactsServer).List(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } @@ -1423,105 +2049,108 @@ var _Contacts_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "github.com/infobloxopen/atlas-contacts-app/pkg/pb/contacts.proto", -} - -func init() { - proto.RegisterFile("github.com/infobloxopen/atlas-contacts-app/pkg/pb/contacts.proto", fileDescriptor0) -} - -var fileDescriptor0 = []byte{ - // 1463 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x72, 0xd3, 0xd6, - 0x17, 0x47, 0x8e, 0xe3, 0x8f, 0x93, 0x10, 0xc2, 0xc5, 0x04, 0xc5, 0xc0, 0x3f, 0x46, 0xf0, 0x6f, - 0x99, 0xa4, 0xb1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b, 0xfe, 0x6c, - 0x45, 0x02, 0xa4, 0x5d, 0x01, 0xd4, 0x22, 0xd8, 0x48, 0xb8, 0x93, 0x38, 0x4a, 0xed, 0x1e, 0x9c, - 0x89, 0xa1, 0x16, 0xb3, 0xb5, 0x07, 0xa5, 0xc7, 0xae, 0xf1, 0x76, 0x82, 0x4f, 0x28, 0x5a, 0xcc, - 0xa1, 0x77, 0xa0, 0x74, 0x8f, 0x58, 0x64, 0xc2, 0xa1, 0x64, 0xf8, 0x7b, 0x50, 0xfa, 0xc4, 0xa4, - 0xbe, 0x40, 0xd1, 0xd0, 0x9c, 0x0e, 0x79, 0xae, 0x89, 0xaa, 0x4a, 0x1a, 0x6d, 0x42, 0xc7, 0x05, - 0x4a, 0xfb, 0x5b, 0x81, 0x65, 0x46, 0x8d, 0x37, 0x20, 0xeb, 0x07, 0x90, 0x77, 0xb9, 0x5e, 0x35, - 0x3b, 0x23, 0xc8, 0x46, 0x6e, 0x34, 0xdc, 0xcc, 0x68, 0x27, 0x5a, 0x12, 0x8d, 0x2e, 0x02, 0x88, - 0xc7, 0x03, 0xd3, 0x50, 0x97, 0x99, 0xe9, 0xa2, 0x58, 0xf9, 0xd8, 0x40, 0xb7, 0x22, 0x97, 0x20, - 0x37, 0xe3, 0x12, 0x70, 0xc5, 0xb5, 0x13, 0xe3, 0xcb, 0x10, 0xe1, 0x77, 0x13, 0x10, 0xa7, 0x25, - 0xbf, 0x00, 0xe2, 0x3c, 0x77, 0x93, 0x09, 0x4e, 0xbd, 0x2d, 0x61, 0x7a, 0x1b, 0x70, 0x26, 0xa6, - 0x44, 0x9c, 0xf6, 0x4e, 0x22, 0xb9, 0xe9, 0x57, 0x4e, 0xa4, 0x56, 0x83, 0xf5, 0x80, 0xb1, 0x31, - 0x37, 0x92, 0x69, 0xbd, 0x03, 0xa7, 0x23, 0x98, 0x45, 0xac, 0x34, 0x01, 0x71, 0x22, 0xbe, 0x61, - 0xb8, 0x31, 0x25, 0x8b, 0x38, 0x72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 0x0e, 0xa4, 0xcd, 0x98, 0xda, 0x69, 0xa6, 0x7b, 0x05, 0x8d, - 0x73, 0x55, 0x66, 0x45, 0xbd, 0xa0, 0xd4, 0x7e, 0xcc, 0x42, 0x8e, 0xf7, 0x72, 0xd4, 0x0d, 0x49, - 0x52, 0x49, 0x23, 0x40, 0x74, 0x2a, 0x48, 0xe6, 0x2d, 0x65, 0xd4, 0xd2, 0x54, 0x66, 0x14, 0x69, - 0x79, 0x5d, 0x7c, 0xc1, 0x84, 0xa7, 0xf7, 0x54, 0xd0, 0xe3, 0x7f, 0x93, 0xc9, 0x8f, 0x19, 0xd9, - 0x9a, 0xba, 0x2f, 0x4c, 0x94, 0x98, 0x89, 0x35, 0xb4, 0x2a, 0x4c, 0xf0, 0x13, 0xf3, 0x43, 0x62, - 0x54, 0xd2, 0x92, 0x3e, 0x2b, 0x8e, 0x94, 0x19, 0x4a, 0xfb, 0x3f, 0x33, 0xb2, 0x55, 0x2e, 0x85, - 0x46, 0x52, 0x29, 0xd1, 0x09, 0x29, 0x51, 0x49, 0xa3, 0x44, 0xcc, 0xea, 0x34, 0x42, 0x6c, 0x8d, - 0x86, 0x9b, 0x79, 0x31, 0xdd, 0xf3, 0xd0, 0xb6, 0xe3, 0xa1, 0x7d, 0x7e, 0x0c, 0x19, 0x2a, 0x93, - 0x64, 0x88, 0x0f, 0x6a, 0xda, 0x29, 0xa6, 0xb7, 0x88, 0x64, 0x56, 0x42, 0x22, 0x7c, 0xb7, 0x0c, - 0x05, 0x59, 0xad, 0x8e, 0xab, 0x17, 0xf1, 0xda, 0x97, 0x5e, 0x2f, 0x12, 0x75, 0x36, 0x52, 0x2f, - 0xc2, 0x91, 0x7f, 0x9e, 0x7a, 0x91, 0x30, 0x75, 0x69, 0x06, 0x62, 0xa2, 0x5e, 0x48, 0xd8, 0x5c, - 0xf5, 0x62, 0x76, 0x4c, 0xa9, 0xbd, 0x23, 0x52, 0x2f, 0xc6, 0xa6, 0x16, 0xa9, 0x17, 0x09, 0xdb, - 0xc7, 0xd4, 0x0b, 0x81, 0x0e, 0xeb, 0x45, 0x3c, 0xcc, 0x05, 0xea, 0x45, 0xb2, 0x49, 0x45, 0xea, - 0x45, 0xf8, 0x5f, 0xc5, 0x13, 0xc8, 0xef, 0x13, 0xdb, 0xd8, 0x7f, 0xb8, 0x8f, 0xd4, 0xb8, 0x86, - 0x71, 0x77, 0x9a, 0xea, 0xf8, 0x45, 0xa6, 0xef, 0x9c, 0x86, 0xe2, 0xbe, 0xea, 0xb4, 0x47, 0xeb, - 0xca, 0xb6, 0xa4, 0x60, 0xe3, 0x4f, 0xe5, 0xa7, 0xbb, 0xbf, 0x28, 0xc8, 0x1e, 0x13, 0x51, 0x7b, - 0x0a, 0x6b, 0x0f, 0x9c, 0x23, 0xbb, 0xd2, 0x20, 0x16, 0xee, 0x61, 0xcf, 0xec, 0xa0, 0xda, 0x91, - 0xef, 0xbb, 0xb4, 0xae, 0xeb, 0xf3, 0xff, 0x45, 0x56, 0x3e, 0xf7, 0xac, 0x2d, 0xe5, 0xef, 0x48, - 0x6c, 0x20, 0x58, 0x5b, 0xba, 0x5e, 0xbd, 0xb6, 0x9d, 0x51, 0x32, 0xb5, 0x75, 0xec, 0xba, 0x96, - 0xd9, 0x61, 0x7f, 0x47, 0xe9, 0xcf, 0xa8, 0x63, 0xd7, 0x27, 0x56, 0x9e, 0xdc, 0x7c, 0xed, 0x3f, - 0xe5, 0x6e, 0xbb, 0xed, 0x76, 0x8e, 0x9d, 0xc5, 0x8d, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x6c, - 0x24, 0xd0, 0xa5, 0xd3, 0x13, 0x00, 0x00, + Metadata: "pkg/pb/contacts.proto", +} + +func init() { proto.RegisterFile("pkg/pb/contacts.proto", fileDescriptor_contacts_579b8531e4c20cb3) } + +var fileDescriptor_contacts_579b8531e4c20cb3 = []byte{ + // 1540 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00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 0x94, 0x9b, 0xb2, 0x14, 0xbc, 0xef, 0xa0, 0x5b, + 0x89, 0x82, 0x2b, 0x4c, 0x28, 0x38, 0x81, 0x57, 0x3f, 0x31, 0x28, 0xbc, 0x44, 0x2d, 0x6d, 0x01, + 0x12, 0x25, 0x20, 0x8a, 0x4d, 0x6e, 0x52, 0x35, 0xcd, 0x9a, 0xcc, 0xca, 0x8c, 0x39, 0xd3, 0x80, + 0x33, 0x43, 0x46, 0xe4, 0x5e, 0xad, 0xa7, 0x18, 0x93, 0x5d, 0xde, 0x92, 0x2f, 0xb7, 0x60, 0x39, + 0x2a, 0x83, 0x21, 0x37, 0xa6, 0xe4, 0xca, 0x6d, 0x38, 0x9d, 0x50, 0x9d, 0x05, 0x7c, 0x0b, 0x90, + 0x20, 0xfd, 0x4b, 0x66, 0x61, 0xc8, 0xc8, 0x2c, 0x8e, 0x6c, 0x02, 0x12, 0x55, 0x33, 0x4b, 0x1e, + 0xb6, 0x00, 0x45, 0x35, 0xc3, 0x55, 0x59, 0xa2, 0x6e, 0x53, 0x15, 0x93, 0x1d, 0x85, 0xaa, 0x97, + 0x7f, 0xf3, 0x50, 0x94, 0xc4, 0x99, 0xb5, 0x62, 0x2e, 0x01, 0xec, 0x91, 0x80, 0x85, 0xbb, 0x89, + 0xba, 0x29, 0xf3, 0x2f, 0x8f, 0xa2, 0xe2, 0xb9, 0x0c, 0x0b, 0x5d, 0xe2, 0x38, 0x2e, 0x16, 0xeb, + 0xa2, 0x84, 0x40, 0x7c, 0xe2, 0x02, 0x17, 0xa0, 0xec, 0xda, 0x4a, 0x3d, 0xcf, 0x97, 0x4b, 0xd1, + 0x07, 0xbe, 0x78, 0x13, 0x4e, 0xfa, 0x01, 0xe9, 0xda, 0xc1, 0xe1, 0x2e, 0xee, 0xda, 0xc4, 0xd5, + 0x0b, 0x91, 0x40, 0xe3, 0x54, 0xc4, 0xf1, 0x65, 0xad, 0xff, 0xcf, 0x6f, 0x73, 0xf9, 0x20, 0xf7, + 0x99, 0xd6, 0x5c, 0x94, 0x52, 0xf7, 0x22, 0xa1, 0x41, 0xc1, 0x16, 0x93, 0x05, 0xbb, 0x0e, 0x05, + 0x6e, 0x83, 0xe9, 0xa5, 0xac, 0xcc, 0x70, 0xd5, 0xa6, 0x14, 0x41, 0xef, 0xc2, 0xe2, 0x3e, 0xed, + 0xe2, 0x5d, 0xdb, 0x71, 0x02, 0xcc, 0x98, 0x5e, 0xce, 0x2a, 0xf1, 0x3b, 0x62, 0xb1, 0xb9, 0x10, + 0x89, 0xca, 0x97, 0x48, 0xf3, 0x19, 0x0d, 0x0e, 0x62, 0x4d, 0x98, 0xa8, 0x19, 0x89, 0x2a, 0xcd, + 0xe1, 0xc6, 0xb0, 0x30, 0x65, 0x63, 0x48, 0xf4, 0xa1, 0xc5, 0x17, 0xea, 0x43, 0x5b, 0xf1, 0x79, + 0x7c, 0x72, 0x2c, 0x53, 0x1a, 0xe7, 0xfa, 0x47, 0xab, 0xa8, 0xbe, 0x0c, 0x4b, 0x5c, 0x74, 0x57, + 0xad, 0xaa, 0x73, 0x1a, 0xdd, 0x80, 0xb2, 0x47, 0xda, 0x07, 0xd1, 0xe6, 0x31, 0x7d, 0x49, 0xe2, + 0xf3, 0xb1, 0x48, 0x4c, 0x38, 0x0f, 0x76, 0x3e, 0x7c, 0xf4, 0x89, 0xed, 0xf6, 0x70, 0x73, 0x20, + 0x97, 0x68, 0x48, 0x2d, 0x98, 0x17, 0x5b, 0xb6, 0x14, 0x93, 0x2f, 0xcf, 0x59, 0xb5, 0x0e, 0x45, + 0x95, 0x40, 0x4e, 0xa9, 0xc6, 0xe9, 0x48, 0x07, 0x72, 0xd7, 0x12, 0x9b, 0xae, 0x24, 0x36, 0x2e, + 0xf6, 0x8f, 0x56, 0xf5, 0x92, 0x16, 0x35, 0xef, 0x16, 0xa5, 0x2e, 0x02, 0xc2, 0x76, 0x25, 0x21, + 0x2a, 0x9a, 0xf9, 0x9d, 0x06, 0x45, 0x95, 0x62, 0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, 0x1f, 0x73, 0x0a, + 0xa8, 0x6a, 0xfb, 0xbe, 0x71, 0xfe, 0x69, 0x4b, 0xe9, 0xdf, 0x56, 0xb2, 0x91, 0x62, 0x7d, 0xee, + 0x7a, 0xed, 0xda, 0x5a, 0x4e, 0xcb, 0xd5, 0x97, 0x6d, 0xdf, 0x77, 0x49, 0x9b, 0xff, 0xe3, 0x68, + 0x3d, 0x65, 0xd4, 0xdb, 0x18, 0xf9, 0xf2, 0xe4, 0xe6, 0xf4, 0x88, 0x96, 0xf8, 0xdf, 0x75, 0xd3, + 0x6f, 0xb5, 0x0a, 0x3c, 0x17, 0x37, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xbe, 0x81, 0xd0, 0x65, + 0x8b, 0x15, 0x00, 0x00, } diff --git a/pkg/pb/contacts.pb.gorm.go b/pkg/pb/contacts.pb.gorm.go index e26f034..3558966 100644 --- a/pkg/pb/contacts.pb.gorm.go +++ b/pkg/pb/contacts.pb.gorm.go @@ -1,11 +1,11 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/infobloxopen/atlas-contacts-app/pkg/pb/contacts.proto +// source: pkg/pb/contacts.proto /* Package pb is a generated protocol buffer package. It is generated from these files: - github.com/infobloxopen/atlas-contacts-app/pkg/pb/contacts.proto + pkg/pb/contacts.proto It has these top-level messages: Profile @@ -44,11 +44,10 @@ package pb import context "context" import errors "errors" -import auth "github.com/infobloxopen/atlas-app-toolkit/auth" -import gorm "github.com/jinzhu/gorm" -import gormpq "github.com/jinzhu/gorm/dialects/postgres" -import gtypes "github.com/infobloxopen/protoc-gen-gorm/types" -import ops "github.com/infobloxopen/atlas-app-toolkit/gorm" +import auth1 "github.com/infobloxopen/atlas-app-toolkit/auth" +import gorm1 "github.com/jinzhu/gorm" +import gorm2 "github.com/infobloxopen/atlas-app-toolkit/gorm" +import resource1 "github.com/infobloxopen/atlas-app-toolkit/gorm/resource" import fmt "fmt" import math "math" @@ -56,6 +55,7 @@ import google_protobuf "github.com/golang/protobuf/ptypes/empty" import _ "google.golang.org/genproto/googleapis/api/annotations" import _ "github.com/lyft/protoc-gen-validate/validate" import _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" +import _ "github.com/infobloxopen/atlas-app-toolkit/rpc/resource" // Reference imports to suppress errors if they are not otherwise used. var _ = fmt.Errorf @@ -65,7 +65,7 @@ type ProfileORM struct { AccountID string Contacts []*ContactORM `gorm:"foreignkey:ProfileId;association_foreignkey:Id"` Groups []*GroupORM `gorm:"foreignkey:ProfileId;association_foreignkey:Id"` - Id uint64 + Id int64 `gorm:"type:serial"` Name string Notes string } @@ -85,7 +85,13 @@ func (m *Profile) ToORM(ctx context.Context) (ProfileORM, error) { return to, err } } - to.Id = m.Id + if m.Id != nil { + if v, err := resource1.DecodeInt64(&Profile{}, m.Id); err != nil { + return to, err + } else { + to.Id = v + } + } to.Name = m.Name to.Notes = m.Notes for _, v := range m.Contacts { @@ -110,7 +116,7 @@ func (m *Profile) ToORM(ctx context.Context) (ProfileORM, error) { to.Groups = append(to.Groups, nil) } } - accountID, err := auth.GetAccountID(ctx, nil) + accountID, err := auth1.GetAccountID(ctx, nil) if err != nil { return to, err } @@ -131,7 +137,11 @@ func (m *ProfileORM) ToPB(ctx context.Context) (Profile, error) { return to, err } } - to.Id = m.Id + if v, err := resource1.EncodeInt64(&Profile{}, m.Id); err != nil { + return to, err + } else { + to.Id = v + } to.Name = m.Name to.Notes = m.Notes for _, v := range m.Contacts { @@ -188,11 +198,11 @@ type ProfileWithAfterToPB interface { type GroupORM struct { AccountID string Contacts []*ContactORM `gorm:"many2many:group_contacts;foreignkey:Id;association_foreignkey:Id;jointable_foreignkey:group_id;association_jointable_foreignkey:contact_id"` - Id uint64 + Id int64 `gorm:"type:serial"` Name string Notes string Profile *ProfileORM `gorm:"foreignkey:ProfileId;association_foreignkey:Id"` - ProfileId uint64 + ProfileId *int64 } // TableName overrides the default tablename generated by GORM @@ -210,7 +220,13 @@ func (m *Group) ToORM(ctx context.Context) (GroupORM, error) { return to, err } } - to.Id = m.Id + if m.Id != nil { + if v, err := resource1.DecodeInt64(&Group{}, m.Id); err != nil { + return to, err + } else { + to.Id = v + } + } to.Name = m.Name to.Notes = m.Notes if m.Profile != nil { @@ -220,7 +236,13 @@ func (m *Group) ToORM(ctx context.Context) (GroupORM, error) { } to.Profile = &tempProfile } - to.ProfileId = m.ProfileId + if m.ProfileId != nil { + if v, err := resource1.DecodeInt64(&Profile{}, m.ProfileId); err != nil { + return to, err + } else { + to.ProfileId = &v + } + } for _, v := range m.Contacts { if v != nil { if tempContacts, cErr := v.ToORM(ctx); cErr == nil { @@ -232,7 +254,7 @@ func (m *Group) ToORM(ctx context.Context) (GroupORM, error) { to.Contacts = append(to.Contacts, nil) } } - accountID, err := auth.GetAccountID(ctx, nil) + accountID, err := auth1.GetAccountID(ctx, nil) if err != nil { return to, err } @@ -253,7 +275,11 @@ func (m *GroupORM) ToPB(ctx context.Context) (Group, error) { return to, err } } - to.Id = m.Id + if v, err := resource1.EncodeInt64(&Group{}, m.Id); err != nil { + return to, err + } else { + to.Id = v + } to.Name = m.Name to.Notes = m.Notes if m.Profile != nil { @@ -263,7 +289,13 @@ func (m *GroupORM) ToPB(ctx context.Context) (Group, error) { } to.Profile = &tempProfile } - to.ProfileId = m.ProfileId + if m.ProfileId != nil { + if v, err := resource1.EncodeInt64(&Profile{}, *m.ProfileId); err != nil { + return to, err + } else { + to.ProfileId = v + } + } for _, v := range m.Contacts { if v != nil { if tempContacts, cErr := v.ToPB(ctx); cErr == nil { @@ -310,13 +342,12 @@ type ContactORM struct { FirstName string Groups []*GroupORM `gorm:"many2many:group_contacts;foreignkey:Id;association_foreignkey:Id;jointable_foreignkey:contact_id;association_jointable_foreignkey:group_id"` HomeAddress *AddressORM `gorm:"foreignkey:HomeAddressContactId;association_foreignkey:Id"` - Id uint64 + Id int64 `gorm:"type:serial"` LastName string MiddleName string - Nicknames *gormpq.Jsonb Notes string Profile *ProfileORM `gorm:"foreignkey:ProfileId;association_foreignkey:Id"` - ProfileId uint64 + ProfileId *int64 WorkAddress *AddressORM `gorm:"foreignkey:WorkAddressContactId;association_foreignkey:Id"` } @@ -335,7 +366,13 @@ func (m *Contact) ToORM(ctx context.Context) (ContactORM, error) { return to, err } } - to.Id = m.Id + if m.Id != nil { + if v, err := resource1.DecodeInt64(&Contact{}, m.Id); err != nil { + return to, err + } else { + to.Id = v + } + } to.FirstName = m.FirstName to.MiddleName = m.MiddleName to.LastName = m.LastName @@ -352,20 +389,26 @@ func (m *Contact) ToORM(ctx context.Context) (ContactORM, error) { } } if m.HomeAddress != nil { - tempAddress, err := m.HomeAddress.ToORM(ctx) + tempHomeAddress, err := m.HomeAddress.ToORM(ctx) if err != nil { return to, err } - to.HomeAddress = &tempAddress + to.HomeAddress = &tempHomeAddress } if m.WorkAddress != nil { - tempAddress, err := m.WorkAddress.ToORM(ctx) + tempWorkAddress, err := m.WorkAddress.ToORM(ctx) if err != nil { return to, err } - to.WorkAddress = &tempAddress + to.WorkAddress = &tempWorkAddress + } + if m.ProfileId != nil { + if v, err := resource1.DecodeInt64(&Profile{}, m.ProfileId); err != nil { + return to, err + } else { + to.ProfileId = &v + } } - to.ProfileId = m.ProfileId if m.Profile != nil { tempProfile, err := m.Profile.ToORM(ctx) if err != nil { @@ -384,10 +427,7 @@ func (m *Contact) ToORM(ctx context.Context) (ContactORM, error) { to.Groups = append(to.Groups, nil) } } - if m.Nicknames != nil { - to.Nicknames = &gormpq.Jsonb{[]byte(m.Nicknames.Value)} - } - accountID, err := auth.GetAccountID(ctx, nil) + accountID, err := auth1.GetAccountID(ctx, nil) if err != nil { return to, err } @@ -408,7 +448,11 @@ func (m *ContactORM) ToPB(ctx context.Context) (Contact, error) { return to, err } } - to.Id = m.Id + if v, err := resource1.EncodeInt64(&Contact{}, m.Id); err != nil { + return to, err + } else { + to.Id = v + } to.FirstName = m.FirstName to.MiddleName = m.MiddleName to.LastName = m.LastName @@ -425,20 +469,26 @@ func (m *ContactORM) ToPB(ctx context.Context) (Contact, error) { } } if m.HomeAddress != nil { - tempAddress, err := m.HomeAddress.ToPB(ctx) + tempHomeAddress, err := m.HomeAddress.ToPB(ctx) if err != nil { return to, err } - to.HomeAddress = &tempAddress + to.HomeAddress = &tempHomeAddress } if m.WorkAddress != nil { - tempAddress, err := m.WorkAddress.ToPB(ctx) + tempWorkAddress, err := m.WorkAddress.ToPB(ctx) if err != nil { return to, err } - to.WorkAddress = &tempAddress + to.WorkAddress = &tempWorkAddress + } + if m.ProfileId != nil { + if v, err := resource1.EncodeInt64(&Profile{}, *m.ProfileId); err != nil { + return to, err + } else { + to.ProfileId = v + } } - to.ProfileId = m.ProfileId if m.Profile != nil { tempProfile, err := m.Profile.ToPB(ctx) if err != nil { @@ -457,9 +507,6 @@ func (m *ContactORM) ToPB(ctx context.Context) (Contact, error) { to.Groups = append(to.Groups, nil) } } - if m.Nicknames != nil { - to.Nicknames = >ypes.JSONValue{Value: string(m.Nicknames.RawMessage)} - } if posthook, ok := interface{}(m).(ContactWithAfterToPB); ok { err = posthook.AfterToPB(ctx, &to) } @@ -492,7 +539,7 @@ type ContactWithAfterToPB interface { type EmailORM struct { AccountID string Address string `gorm:"unique"` - ContactId uint64 + ContactId *int64 Id uint64 IsPrimary bool } @@ -514,7 +561,7 @@ func (m *Email) ToORM(ctx context.Context) (EmailORM, error) { } to.Id = m.Id to.Address = m.Address - accountID, err := auth.GetAccountID(ctx, nil) + accountID, err := auth1.GetAccountID(ctx, nil) if err != nil { return to, err } @@ -571,9 +618,9 @@ type AddressORM struct { Address string City string Country string - HomeAddressContactId uint64 + HomeAddressContactId *int64 State string - WorkAddressContactId uint64 + WorkAddressContactId *int64 Zip string } @@ -597,7 +644,7 @@ func (m *Address) ToORM(ctx context.Context) (AddressORM, error) { to.State = m.State to.Zip = m.Zip to.Country = m.Country - accountID, err := auth.GetAccountID(ctx, nil) + accountID, err := auth1.GetAccountID(ctx, nil) if err != nil { return to, err } @@ -653,7 +700,7 @@ type AddressWithAfterToPB interface { } // DefaultCreateProfile executes a basic gorm create call -func DefaultCreateProfile(ctx context.Context, in *Profile, db *gorm.DB) (*Profile, error) { +func DefaultCreateProfile(ctx context.Context, in *Profile, db *gorm1.DB) (*Profile, error) { if in == nil { return nil, errors.New("Nil argument to DefaultCreateProfile") } @@ -669,7 +716,7 @@ func DefaultCreateProfile(ctx context.Context, in *Profile, db *gorm.DB) (*Profi } // DefaultReadProfile executes a basic gorm read call -func DefaultReadProfile(ctx context.Context, in *Profile, db *gorm.DB) (*Profile, error) { +func DefaultReadProfile(ctx context.Context, in *Profile, db *gorm1.DB) (*Profile, error) { if in == nil { return nil, errors.New("Nil argument to DefaultReadProfile") } @@ -687,11 +734,11 @@ func DefaultReadProfile(ctx context.Context, in *Profile, db *gorm.DB) (*Profile } // DefaultUpdateProfile executes a basic gorm update call -func DefaultUpdateProfile(ctx context.Context, in *Profile, db *gorm.DB) (*Profile, error) { +func DefaultUpdateProfile(ctx context.Context, in *Profile, db *gorm1.DB) (*Profile, error) { if in == nil { return nil, errors.New("Nil argument to DefaultUpdateProfile") } - accountID, err := auth.GetAccountID(ctx, nil) + accountID, err := auth1.GetAccountID(ctx, nil) if err != nil { return nil, err } @@ -713,7 +760,7 @@ func DefaultUpdateProfile(ctx context.Context, in *Profile, db *gorm.DB) (*Profi return &pbResponse, err } -func DefaultDeleteProfile(ctx context.Context, in *Profile, db *gorm.DB) error { +func DefaultDeleteProfile(ctx context.Context, in *Profile, db *gorm1.DB) error { if in == nil { return errors.New("Nil argument to DefaultDeleteProfile") } @@ -729,7 +776,7 @@ func DefaultDeleteProfile(ctx context.Context, in *Profile, db *gorm.DB) error { } // DefaultStrictUpdateProfile clears first level 1:many children and then executes a gorm update call -func DefaultStrictUpdateProfile(ctx context.Context, in *Profile, db *gorm.DB) (*Profile, error) { +func DefaultStrictUpdateProfile(ctx context.Context, in *Profile, db *gorm1.DB) (*Profile, error) { if in == nil { return nil, fmt.Errorf("Nil argument to DefaultCascadedUpdateProfile") } @@ -741,7 +788,8 @@ func DefaultStrictUpdateProfile(ctx context.Context, in *Profile, db *gorm.DB) ( if ormObj.Id == 0 { return nil, errors.New("Can't do overwriting update with no Id value for ProfileORM") } - filterContacts.ProfileId = ormObj.Id + filterContacts.ProfileId = new(int64) + *filterContacts.ProfileId = ormObj.Id filterContacts.AccountID = ormObj.AccountID if err = db.Where(filterContacts).Delete(ContactORM{}).Error; err != nil { return nil, err @@ -750,7 +798,8 @@ func DefaultStrictUpdateProfile(ctx context.Context, in *Profile, db *gorm.DB) ( if ormObj.Id == 0 { return nil, errors.New("Can't do overwriting update with no Id value for ProfileORM") } - filterGroups.ProfileId = ormObj.Id + filterGroups.ProfileId = new(int64) + *filterGroups.ProfileId = ormObj.Id filterGroups.AccountID = ormObj.AccountID if err = db.Where(filterGroups).Delete(GroupORM{}).Error; err != nil { return nil, err @@ -767,9 +816,9 @@ func DefaultStrictUpdateProfile(ctx context.Context, in *Profile, db *gorm.DB) ( } // DefaultListProfile executes a gorm list call -func DefaultListProfile(ctx context.Context, db *gorm.DB) ([]*Profile, error) { +func DefaultListProfile(ctx context.Context, db *gorm1.DB) ([]*Profile, error) { ormResponse := []ProfileORM{} - db, err := ops.ApplyCollectionOperators(db, ctx) + db, err := gorm2.ApplyCollectionOperators(db, ctx) if err != nil { return nil, err } @@ -780,6 +829,7 @@ func DefaultListProfile(ctx context.Context, db *gorm.DB) ([]*Profile, error) { } db = db.Where(&ormParams) db = db.Preload("Contacts").Preload("Groups") + db = db.Order("id") if err := db.Find(&ormResponse).Error; err != nil { return nil, err } @@ -795,7 +845,7 @@ func DefaultListProfile(ctx context.Context, db *gorm.DB) ([]*Profile, error) { } // DefaultCreateGroup executes a basic gorm create call -func DefaultCreateGroup(ctx context.Context, in *Group, db *gorm.DB) (*Group, error) { +func DefaultCreateGroup(ctx context.Context, in *Group, db *gorm1.DB) (*Group, error) { if in == nil { return nil, errors.New("Nil argument to DefaultCreateGroup") } @@ -811,7 +861,7 @@ func DefaultCreateGroup(ctx context.Context, in *Group, db *gorm.DB) (*Group, er } // DefaultReadGroup executes a basic gorm read call -func DefaultReadGroup(ctx context.Context, in *Group, db *gorm.DB) (*Group, error) { +func DefaultReadGroup(ctx context.Context, in *Group, db *gorm1.DB) (*Group, error) { if in == nil { return nil, errors.New("Nil argument to DefaultReadGroup") } @@ -829,11 +879,11 @@ func DefaultReadGroup(ctx context.Context, in *Group, db *gorm.DB) (*Group, erro } // DefaultUpdateGroup executes a basic gorm update call -func DefaultUpdateGroup(ctx context.Context, in *Group, db *gorm.DB) (*Group, error) { +func DefaultUpdateGroup(ctx context.Context, in *Group, db *gorm1.DB) (*Group, error) { if in == nil { return nil, errors.New("Nil argument to DefaultUpdateGroup") } - accountID, err := auth.GetAccountID(ctx, nil) + accountID, err := auth1.GetAccountID(ctx, nil) if err != nil { return nil, err } @@ -855,7 +905,7 @@ func DefaultUpdateGroup(ctx context.Context, in *Group, db *gorm.DB) (*Group, er return &pbResponse, err } -func DefaultDeleteGroup(ctx context.Context, in *Group, db *gorm.DB) error { +func DefaultDeleteGroup(ctx context.Context, in *Group, db *gorm1.DB) error { if in == nil { return errors.New("Nil argument to DefaultDeleteGroup") } @@ -871,7 +921,7 @@ func DefaultDeleteGroup(ctx context.Context, in *Group, db *gorm.DB) error { } // DefaultStrictUpdateGroup clears first level 1:many children and then executes a gorm update call -func DefaultStrictUpdateGroup(ctx context.Context, in *Group, db *gorm.DB) (*Group, error) { +func DefaultStrictUpdateGroup(ctx context.Context, in *Group, db *gorm1.DB) (*Group, error) { if in == nil { return nil, fmt.Errorf("Nil argument to DefaultCascadedUpdateGroup") } @@ -891,9 +941,9 @@ func DefaultStrictUpdateGroup(ctx context.Context, in *Group, db *gorm.DB) (*Gro } // DefaultListGroup executes a gorm list call -func DefaultListGroup(ctx context.Context, db *gorm.DB) ([]*Group, error) { +func DefaultListGroup(ctx context.Context, db *gorm1.DB) ([]*Group, error) { ormResponse := []GroupORM{} - db, err := ops.ApplyCollectionOperators(db, ctx) + db, err := gorm2.ApplyCollectionOperators(db, ctx) if err != nil { return nil, err } @@ -904,6 +954,7 @@ func DefaultListGroup(ctx context.Context, db *gorm.DB) ([]*Group, error) { } db = db.Where(&ormParams) db = db.Preload("Contacts").Preload("Profile") + db = db.Order("id") if err := db.Find(&ormResponse).Error; err != nil { return nil, err } @@ -919,7 +970,7 @@ func DefaultListGroup(ctx context.Context, db *gorm.DB) ([]*Group, error) { } // DefaultCreateContact executes a basic gorm create call -func DefaultCreateContact(ctx context.Context, in *Contact, db *gorm.DB) (*Contact, error) { +func DefaultCreateContact(ctx context.Context, in *Contact, db *gorm1.DB) (*Contact, error) { if in == nil { return nil, errors.New("Nil argument to DefaultCreateContact") } @@ -935,7 +986,7 @@ func DefaultCreateContact(ctx context.Context, in *Contact, db *gorm.DB) (*Conta } // DefaultReadContact executes a basic gorm read call -func DefaultReadContact(ctx context.Context, in *Contact, db *gorm.DB) (*Contact, error) { +func DefaultReadContact(ctx context.Context, in *Contact, db *gorm1.DB) (*Contact, error) { if in == nil { return nil, errors.New("Nil argument to DefaultReadContact") } @@ -953,11 +1004,11 @@ func DefaultReadContact(ctx context.Context, in *Contact, db *gorm.DB) (*Contact } // DefaultUpdateContact executes a basic gorm update call -func DefaultUpdateContact(ctx context.Context, in *Contact, db *gorm.DB) (*Contact, error) { +func DefaultUpdateContact(ctx context.Context, in *Contact, db *gorm1.DB) (*Contact, error) { if in == nil { return nil, errors.New("Nil argument to DefaultUpdateContact") } - accountID, err := auth.GetAccountID(ctx, nil) + accountID, err := auth1.GetAccountID(ctx, nil) if err != nil { return nil, err } @@ -979,7 +1030,7 @@ func DefaultUpdateContact(ctx context.Context, in *Contact, db *gorm.DB) (*Conta return &pbResponse, err } -func DefaultDeleteContact(ctx context.Context, in *Contact, db *gorm.DB) error { +func DefaultDeleteContact(ctx context.Context, in *Contact, db *gorm1.DB) error { if in == nil { return errors.New("Nil argument to DefaultDeleteContact") } @@ -995,7 +1046,7 @@ func DefaultDeleteContact(ctx context.Context, in *Contact, db *gorm.DB) error { } // DefaultStrictUpdateContact clears first level 1:many children and then executes a gorm update call -func DefaultStrictUpdateContact(ctx context.Context, in *Contact, db *gorm.DB) (*Contact, error) { +func DefaultStrictUpdateContact(ctx context.Context, in *Contact, db *gorm1.DB) (*Contact, error) { if in == nil { return nil, fmt.Errorf("Nil argument to DefaultCascadedUpdateContact") } @@ -1007,7 +1058,8 @@ func DefaultStrictUpdateContact(ctx context.Context, in *Contact, db *gorm.DB) ( if ormObj.Id == 0 { return nil, errors.New("Can't do overwriting update with no Id value for ContactORM") } - filterEmails.ContactId = ormObj.Id + filterEmails.ContactId = new(int64) + *filterEmails.ContactId = ormObj.Id filterEmails.AccountID = ormObj.AccountID if err = db.Where(filterEmails).Delete(EmailORM{}).Error; err != nil { return nil, err @@ -1016,7 +1068,8 @@ func DefaultStrictUpdateContact(ctx context.Context, in *Contact, db *gorm.DB) ( if ormObj.Id == 0 { return nil, errors.New("Can't do overwriting update with no Id value for ContactORM") } - filterHomeAddress.HomeAddressContactId = ormObj.Id + filterHomeAddress.HomeAddressContactId = new(int64) + *filterHomeAddress.HomeAddressContactId = ormObj.Id filterHomeAddress.AccountID = ormObj.AccountID if err = db.Where(filterHomeAddress).Delete(AddressORM{}).Error; err != nil { return nil, err @@ -1025,7 +1078,8 @@ func DefaultStrictUpdateContact(ctx context.Context, in *Contact, db *gorm.DB) ( if ormObj.Id == 0 { return nil, errors.New("Can't do overwriting update with no Id value for ContactORM") } - filterWorkAddress.WorkAddressContactId = ormObj.Id + filterWorkAddress.WorkAddressContactId = new(int64) + *filterWorkAddress.WorkAddressContactId = ormObj.Id filterWorkAddress.AccountID = ormObj.AccountID if err = db.Where(filterWorkAddress).Delete(AddressORM{}).Error; err != nil { return nil, err @@ -1042,9 +1096,9 @@ func DefaultStrictUpdateContact(ctx context.Context, in *Contact, db *gorm.DB) ( } // DefaultListContact executes a gorm list call -func DefaultListContact(ctx context.Context, db *gorm.DB) ([]*Contact, error) { +func DefaultListContact(ctx context.Context, db *gorm1.DB) ([]*Contact, error) { ormResponse := []ContactORM{} - db, err := ops.ApplyCollectionOperators(db, ctx) + db, err := gorm2.ApplyCollectionOperators(db, ctx) if err != nil { return nil, err } @@ -1055,6 +1109,7 @@ func DefaultListContact(ctx context.Context, db *gorm.DB) ([]*Contact, error) { } db = db.Where(&ormParams) db = db.Preload("Emails").Preload("Groups").Preload("HomeAddress").Preload("Profile").Preload("WorkAddress") + db = db.Order("id") if err := db.Find(&ormResponse).Error; err != nil { return nil, err } @@ -1070,7 +1125,7 @@ func DefaultListContact(ctx context.Context, db *gorm.DB) ([]*Contact, error) { } // DefaultCreateEmail executes a basic gorm create call -func DefaultCreateEmail(ctx context.Context, in *Email, db *gorm.DB) (*Email, error) { +func DefaultCreateEmail(ctx context.Context, in *Email, db *gorm1.DB) (*Email, error) { if in == nil { return nil, errors.New("Nil argument to DefaultCreateEmail") } @@ -1086,7 +1141,7 @@ func DefaultCreateEmail(ctx context.Context, in *Email, db *gorm.DB) (*Email, er } // DefaultReadEmail executes a basic gorm read call -func DefaultReadEmail(ctx context.Context, in *Email, db *gorm.DB) (*Email, error) { +func DefaultReadEmail(ctx context.Context, in *Email, db *gorm1.DB) (*Email, error) { if in == nil { return nil, errors.New("Nil argument to DefaultReadEmail") } @@ -1103,11 +1158,11 @@ func DefaultReadEmail(ctx context.Context, in *Email, db *gorm.DB) (*Email, erro } // DefaultUpdateEmail executes a basic gorm update call -func DefaultUpdateEmail(ctx context.Context, in *Email, db *gorm.DB) (*Email, error) { +func DefaultUpdateEmail(ctx context.Context, in *Email, db *gorm1.DB) (*Email, error) { if in == nil { return nil, errors.New("Nil argument to DefaultUpdateEmail") } - accountID, err := auth.GetAccountID(ctx, nil) + accountID, err := auth1.GetAccountID(ctx, nil) if err != nil { return nil, err } @@ -1129,7 +1184,7 @@ func DefaultUpdateEmail(ctx context.Context, in *Email, db *gorm.DB) (*Email, er return &pbResponse, err } -func DefaultDeleteEmail(ctx context.Context, in *Email, db *gorm.DB) error { +func DefaultDeleteEmail(ctx context.Context, in *Email, db *gorm1.DB) error { if in == nil { return errors.New("Nil argument to DefaultDeleteEmail") } @@ -1145,7 +1200,7 @@ func DefaultDeleteEmail(ctx context.Context, in *Email, db *gorm.DB) error { } // DefaultStrictUpdateEmail clears first level 1:many children and then executes a gorm update call -func DefaultStrictUpdateEmail(ctx context.Context, in *Email, db *gorm.DB) (*Email, error) { +func DefaultStrictUpdateEmail(ctx context.Context, in *Email, db *gorm1.DB) (*Email, error) { if in == nil { return nil, fmt.Errorf("Nil argument to DefaultCascadedUpdateEmail") } @@ -1165,9 +1220,9 @@ func DefaultStrictUpdateEmail(ctx context.Context, in *Email, db *gorm.DB) (*Ema } // DefaultListEmail executes a gorm list call -func DefaultListEmail(ctx context.Context, db *gorm.DB) ([]*Email, error) { +func DefaultListEmail(ctx context.Context, db *gorm1.DB) ([]*Email, error) { ormResponse := []EmailORM{} - db, err := ops.ApplyCollectionOperators(db, ctx) + db, err := gorm2.ApplyCollectionOperators(db, ctx) if err != nil { return nil, err } @@ -1177,6 +1232,7 @@ func DefaultListEmail(ctx context.Context, db *gorm.DB) ([]*Email, error) { return nil, err } db = db.Where(&ormParams) + db = db.Order("id") if err := db.Find(&ormResponse).Error; err != nil { return nil, err } @@ -1192,7 +1248,7 @@ func DefaultListEmail(ctx context.Context, db *gorm.DB) ([]*Email, error) { } // DefaultCreateAddress executes a basic gorm create call -func DefaultCreateAddress(ctx context.Context, in *Address, db *gorm.DB) (*Address, error) { +func DefaultCreateAddress(ctx context.Context, in *Address, db *gorm1.DB) (*Address, error) { if in == nil { return nil, errors.New("Nil argument to DefaultCreateAddress") } @@ -1208,9 +1264,9 @@ func DefaultCreateAddress(ctx context.Context, in *Address, db *gorm.DB) (*Addre } // DefaultListAddress executes a gorm list call -func DefaultListAddress(ctx context.Context, db *gorm.DB) ([]*Address, error) { +func DefaultListAddress(ctx context.Context, db *gorm1.DB) ([]*Address, error) { ormResponse := []AddressORM{} - db, err := ops.ApplyCollectionOperators(db, ctx) + db, err := gorm2.ApplyCollectionOperators(db, ctx) if err != nil { return nil, err } @@ -1235,7 +1291,7 @@ func DefaultListAddress(ctx context.Context, db *gorm.DB) ([]*Address, error) { } type ProfilesDefaultServer struct { - DB *gorm.DB + DB *gorm1.DB } type ProfilesCreateCustomHandler interface { CustomCreate(context.Context, *CreateProfileRequest) (*CreateProfileResponse, error) @@ -1246,7 +1302,8 @@ func (m *ProfilesDefaultServer) Create(ctx context.Context, in *CreateProfileReq if custom, ok := interface{}(m).(ProfilesCreateCustomHandler); ok { return custom.CustomCreate(ctx, in) } - res, err := DefaultCreateProfile(ctx, in.GetPayload(), m.DB) + db := m.DB + res, err := DefaultCreateProfile(ctx, in.GetPayload(), db) if err != nil { return nil, err } @@ -1262,7 +1319,8 @@ func (m *ProfilesDefaultServer) Read(ctx context.Context, in *ReadProfileRequest if custom, ok := interface{}(m).(ProfilesReadCustomHandler); ok { return custom.CustomRead(ctx, in) } - res, err := DefaultReadProfile(ctx, &Profile{Id: in.GetId()}, m.DB) + db := m.DB + res, err := DefaultReadProfile(ctx, &Profile{Id: in.GetId()}, db) if err != nil { return nil, err } @@ -1278,7 +1336,8 @@ func (m *ProfilesDefaultServer) Update(ctx context.Context, in *UpdateProfileReq if custom, ok := interface{}(m).(ProfilesUpdateCustomHandler); ok { return custom.CustomUpdate(ctx, in) } - res, err := DefaultStrictUpdateProfile(ctx, in.GetPayload(), m.DB) + db := m.DB + res, err := DefaultStrictUpdateProfile(ctx, in.GetPayload(), db) if err != nil { return nil, err } @@ -1294,7 +1353,8 @@ func (m *ProfilesDefaultServer) Delete(ctx context.Context, in *DeleteProfileReq if custom, ok := interface{}(m).(ProfilesDeleteCustomHandler); ok { return custom.CustomDelete(ctx, in) } - return &google_protobuf.Empty{}, DefaultDeleteProfile(ctx, &Profile{Id: in.GetId()}, m.DB) + db := m.DB + return &google_protobuf.Empty{}, DefaultDeleteProfile(ctx, &Profile{Id: in.GetId()}, db) } type ProfilesListCustomHandler interface { @@ -1306,7 +1366,8 @@ func (m *ProfilesDefaultServer) List(ctx context.Context, in *google_protobuf.Em if custom, ok := interface{}(m).(ProfilesListCustomHandler); ok { return custom.CustomList(ctx, in) } - res, err := DefaultListProfile(ctx, m.DB) + db := m.DB + res, err := DefaultListProfile(ctx, db) if err != nil { return nil, err } @@ -1314,7 +1375,7 @@ func (m *ProfilesDefaultServer) List(ctx context.Context, in *google_protobuf.Em } type GroupsDefaultServer struct { - DB *gorm.DB + DB *gorm1.DB } type GroupsCreateCustomHandler interface { CustomCreate(context.Context, *CreateGroupRequest) (*CreateGroupResponse, error) @@ -1325,7 +1386,8 @@ func (m *GroupsDefaultServer) Create(ctx context.Context, in *CreateGroupRequest if custom, ok := interface{}(m).(GroupsCreateCustomHandler); ok { return custom.CustomCreate(ctx, in) } - res, err := DefaultCreateGroup(ctx, in.GetPayload(), m.DB) + db := m.DB + res, err := DefaultCreateGroup(ctx, in.GetPayload(), db) if err != nil { return nil, err } @@ -1341,7 +1403,8 @@ func (m *GroupsDefaultServer) Read(ctx context.Context, in *ReadGroupRequest) (* if custom, ok := interface{}(m).(GroupsReadCustomHandler); ok { return custom.CustomRead(ctx, in) } - res, err := DefaultReadGroup(ctx, &Group{Id: in.GetId()}, m.DB) + db := m.DB + res, err := DefaultReadGroup(ctx, &Group{Id: in.GetId()}, db) if err != nil { return nil, err } @@ -1357,7 +1420,8 @@ func (m *GroupsDefaultServer) Update(ctx context.Context, in *UpdateGroupRequest if custom, ok := interface{}(m).(GroupsUpdateCustomHandler); ok { return custom.CustomUpdate(ctx, in) } - res, err := DefaultStrictUpdateGroup(ctx, in.GetPayload(), m.DB) + db := m.DB + res, err := DefaultStrictUpdateGroup(ctx, in.GetPayload(), db) if err != nil { return nil, err } @@ -1373,7 +1437,8 @@ func (m *GroupsDefaultServer) Delete(ctx context.Context, in *DeleteGroupRequest if custom, ok := interface{}(m).(GroupsDeleteCustomHandler); ok { return custom.CustomDelete(ctx, in) } - return &google_protobuf.Empty{}, DefaultDeleteGroup(ctx, &Group{Id: in.GetId()}, m.DB) + db := m.DB + return &google_protobuf.Empty{}, DefaultDeleteGroup(ctx, &Group{Id: in.GetId()}, db) } type GroupsListCustomHandler interface { @@ -1385,7 +1450,8 @@ func (m *GroupsDefaultServer) List(ctx context.Context, in *google_protobuf.Empt if custom, ok := interface{}(m).(GroupsListCustomHandler); ok { return custom.CustomList(ctx, in) } - res, err := DefaultListGroup(ctx, m.DB) + db := m.DB + res, err := DefaultListGroup(ctx, db) if err != nil { return nil, err } @@ -1393,7 +1459,7 @@ func (m *GroupsDefaultServer) List(ctx context.Context, in *google_protobuf.Empt } type ContactsDefaultServer struct { - DB *gorm.DB + DB *gorm1.DB } type ContactsCreateCustomHandler interface { CustomCreate(context.Context, *CreateContactRequest) (*CreateContactResponse, error) @@ -1404,7 +1470,8 @@ func (m *ContactsDefaultServer) Create(ctx context.Context, in *CreateContactReq if custom, ok := interface{}(m).(ContactsCreateCustomHandler); ok { return custom.CustomCreate(ctx, in) } - res, err := DefaultCreateContact(ctx, in.GetPayload(), m.DB) + db := m.DB + res, err := DefaultCreateContact(ctx, in.GetPayload(), db) if err != nil { return nil, err } @@ -1420,7 +1487,8 @@ func (m *ContactsDefaultServer) Read(ctx context.Context, in *ReadContactRequest if custom, ok := interface{}(m).(ContactsReadCustomHandler); ok { return custom.CustomRead(ctx, in) } - res, err := DefaultReadContact(ctx, &Contact{Id: in.GetId()}, m.DB) + db := m.DB + res, err := DefaultReadContact(ctx, &Contact{Id: in.GetId()}, db) if err != nil { return nil, err } @@ -1436,7 +1504,8 @@ func (m *ContactsDefaultServer) Update(ctx context.Context, in *UpdateContactReq if custom, ok := interface{}(m).(ContactsUpdateCustomHandler); ok { return custom.CustomUpdate(ctx, in) } - res, err := DefaultStrictUpdateContact(ctx, in.GetPayload(), m.DB) + db := m.DB + res, err := DefaultStrictUpdateContact(ctx, in.GetPayload(), db) if err != nil { return nil, err } @@ -1452,7 +1521,8 @@ func (m *ContactsDefaultServer) Delete(ctx context.Context, in *DeleteContactReq if custom, ok := interface{}(m).(ContactsDeleteCustomHandler); ok { return custom.CustomDelete(ctx, in) } - return &google_protobuf.Empty{}, DefaultDeleteContact(ctx, &Contact{Id: in.GetId()}, m.DB) + db := m.DB + return &google_protobuf.Empty{}, DefaultDeleteContact(ctx, &Contact{Id: in.GetId()}, db) } type ContactsListCustomHandler interface { @@ -1464,7 +1534,8 @@ func (m *ContactsDefaultServer) List(ctx context.Context, in *google_protobuf.Em if custom, ok := interface{}(m).(ContactsListCustomHandler); ok { return custom.CustomList(ctx, in) } - res, err := DefaultListContact(ctx, m.DB) + db := m.DB + res, err := DefaultListContact(ctx, db) if err != nil { return nil, err } diff --git a/pkg/pb/contacts.pb.gw.go b/pkg/pb/contacts.pb.gw.go index 78eb69f..d85b5a8 100644 --- a/pkg/pb/contacts.pb.gw.go +++ b/pkg/pb/contacts.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: github.com/infobloxopen/atlas-contacts-app/pkg/pb/contacts.proto +// source: pkg/pb/contacts.proto /* Package pb is a reverse proxy. @@ -33,7 +33,7 @@ func request_Profiles_Create_0(ctx context.Context, marshaler runtime.Marshaler, var protoReq CreateProfileRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Payload); err != nil { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Payload); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -42,6 +42,10 @@ func request_Profiles_Create_0(ctx context.Context, marshaler runtime.Marshaler, } +var ( + filter_Profiles_Read_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "resource_id": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} +) + func request_Profiles_Read_0(ctx context.Context, marshaler runtime.Marshaler, client ProfilesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq ReadProfileRequest var metadata runtime.ServerMetadata @@ -53,15 +57,19 @@ func request_Profiles_Read_0(ctx context.Context, marshaler runtime.Marshaler, c _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["id.resource_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id.resource_id") } - protoReq.Id, err = runtime.Uint64(val) + err = runtime.PopulateFieldFromPath(&protoReq, "id.resource_id", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id.resource_id", err) + } + + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Profiles_Read_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.Read(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -73,7 +81,7 @@ func request_Profiles_Update_0(ctx context.Context, marshaler runtime.Marshaler, var protoReq UpdateProfileRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Payload); err != nil { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Payload); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -84,15 +92,15 @@ func request_Profiles_Update_0(ctx context.Context, marshaler runtime.Marshaler, _ = err ) - val, ok = pathParams["payload.id"] + val, ok = pathParams["payload.id.resource_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "payload.id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "payload.id.resource_id") } - err = runtime.PopulateFieldFromPath(&protoReq, "payload.id", val) + err = runtime.PopulateFieldFromPath(&protoReq, "payload.id.resource_id", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "payload.id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "payload.id.resource_id", err) } msg, err := client.Update(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -100,6 +108,10 @@ func request_Profiles_Update_0(ctx context.Context, marshaler runtime.Marshaler, } +var ( + filter_Profiles_Delete_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "resource_id": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} +) + func request_Profiles_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client ProfilesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq DeleteProfileRequest var metadata runtime.ServerMetadata @@ -111,15 +123,19 @@ func request_Profiles_Delete_0(ctx context.Context, marshaler runtime.Marshaler, _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["id.resource_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id.resource_id") } - protoReq.Id, err = runtime.Uint64(val) + err = runtime.PopulateFieldFromPath(&protoReq, "id.resource_id", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id.resource_id", err) + } + + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Profiles_Delete_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -140,7 +156,7 @@ func request_Groups_Create_0(ctx context.Context, marshaler runtime.Marshaler, c var protoReq CreateGroupRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Payload); err != nil { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Payload); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -149,6 +165,10 @@ func request_Groups_Create_0(ctx context.Context, marshaler runtime.Marshaler, c } +var ( + filter_Groups_Read_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "resource_id": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} +) + func request_Groups_Read_0(ctx context.Context, marshaler runtime.Marshaler, client GroupsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq ReadGroupRequest var metadata runtime.ServerMetadata @@ -160,15 +180,19 @@ func request_Groups_Read_0(ctx context.Context, marshaler runtime.Marshaler, cli _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["id.resource_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id.resource_id") } - protoReq.Id, err = runtime.Uint64(val) + err = runtime.PopulateFieldFromPath(&protoReq, "id.resource_id", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id.resource_id", err) + } + + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Groups_Read_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.Read(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -180,7 +204,7 @@ func request_Groups_Update_0(ctx context.Context, marshaler runtime.Marshaler, c var protoReq UpdateGroupRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Payload); err != nil { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Payload); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -191,15 +215,15 @@ func request_Groups_Update_0(ctx context.Context, marshaler runtime.Marshaler, c _ = err ) - val, ok = pathParams["payload.id"] + val, ok = pathParams["payload.id.resource_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "payload.id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "payload.id.resource_id") } - err = runtime.PopulateFieldFromPath(&protoReq, "payload.id", val) + err = runtime.PopulateFieldFromPath(&protoReq, "payload.id.resource_id", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "payload.id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "payload.id.resource_id", err) } msg, err := client.Update(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -207,6 +231,10 @@ func request_Groups_Update_0(ctx context.Context, marshaler runtime.Marshaler, c } +var ( + filter_Groups_Delete_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "resource_id": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} +) + func request_Groups_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client GroupsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq DeleteGroupRequest var metadata runtime.ServerMetadata @@ -218,15 +246,19 @@ func request_Groups_Delete_0(ctx context.Context, marshaler runtime.Marshaler, c _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["id.resource_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id.resource_id") } - protoReq.Id, err = runtime.Uint64(val) + err = runtime.PopulateFieldFromPath(&protoReq, "id.resource_id", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id.resource_id", err) + } + + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Groups_Delete_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -247,7 +279,7 @@ func request_Contacts_Create_0(ctx context.Context, marshaler runtime.Marshaler, var protoReq CreateContactRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Payload); err != nil { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Payload); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -256,6 +288,10 @@ func request_Contacts_Create_0(ctx context.Context, marshaler runtime.Marshaler, } +var ( + filter_Contacts_Read_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "resource_id": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} +) + func request_Contacts_Read_0(ctx context.Context, marshaler runtime.Marshaler, client ContactsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq ReadContactRequest var metadata runtime.ServerMetadata @@ -267,15 +303,19 @@ func request_Contacts_Read_0(ctx context.Context, marshaler runtime.Marshaler, c _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["id.resource_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id.resource_id") } - protoReq.Id, err = runtime.Uint64(val) + err = runtime.PopulateFieldFromPath(&protoReq, "id.resource_id", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id.resource_id", err) + } + + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Contacts_Read_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.Read(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -287,7 +327,7 @@ func request_Contacts_Update_0(ctx context.Context, marshaler runtime.Marshaler, var protoReq UpdateContactRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Payload); err != nil { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Payload); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -298,15 +338,15 @@ func request_Contacts_Update_0(ctx context.Context, marshaler runtime.Marshaler, _ = err ) - val, ok = pathParams["payload.id"] + val, ok = pathParams["payload.id.resource_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "payload.id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "payload.id.resource_id") } - err = runtime.PopulateFieldFromPath(&protoReq, "payload.id", val) + err = runtime.PopulateFieldFromPath(&protoReq, "payload.id.resource_id", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "payload.id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "payload.id.resource_id", err) } msg, err := client.Update(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -314,6 +354,10 @@ func request_Contacts_Update_0(ctx context.Context, marshaler runtime.Marshaler, } +var ( + filter_Contacts_Delete_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "resource_id": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} +) + func request_Contacts_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client ContactsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq DeleteContactRequest var metadata runtime.ServerMetadata @@ -325,15 +369,19 @@ func request_Contacts_Delete_0(ctx context.Context, marshaler runtime.Marshaler, _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["id.resource_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id.resource_id") } - protoReq.Id, err = runtime.Uint64(val) + err = runtime.PopulateFieldFromPath(&protoReq, "id.resource_id", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id.resource_id", err) + } + + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Contacts_Delete_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -354,7 +402,7 @@ func request_Contacts_SendSMS_0(ctx context.Context, marshaler runtime.Marshaler var protoReq SMSRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -570,11 +618,11 @@ func RegisterProfilesHandlerClient(ctx context.Context, mux *runtime.ServeMux, c var ( pattern_Profiles_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"profiles"}, "")) - pattern_Profiles_Read_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"profiles", "id"}, "")) + pattern_Profiles_Read_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"profiles", "id.resource_id"}, "")) - pattern_Profiles_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"profiles", "payload.id"}, "")) + pattern_Profiles_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"profiles", "payload.id.resource_id"}, "")) - pattern_Profiles_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"profiles", "id"}, "")) + pattern_Profiles_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"profiles", "id.resource_id"}, "")) pattern_Profiles_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"profiles"}, "")) ) @@ -780,11 +828,11 @@ func RegisterGroupsHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli var ( pattern_Groups_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"groups"}, "")) - pattern_Groups_Read_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"groups", "id"}, "")) + pattern_Groups_Read_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"groups", "id.resource_id"}, "")) - pattern_Groups_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"groups", "payload.id"}, "")) + pattern_Groups_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"groups", "payload.id.resource_id"}, "")) - pattern_Groups_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"groups", "id"}, "")) + pattern_Groups_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"groups", "id.resource_id"}, "")) pattern_Groups_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"groups"}, "")) ) @@ -1019,11 +1067,11 @@ func RegisterContactsHandlerClient(ctx context.Context, mux *runtime.ServeMux, c var ( pattern_Contacts_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"contacts"}, "")) - pattern_Contacts_Read_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"contacts", "id"}, "")) + pattern_Contacts_Read_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"contacts", "id.resource_id"}, "")) - pattern_Contacts_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"contacts", "payload.id"}, "")) + pattern_Contacts_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"contacts", "payload.id.resource_id"}, "")) - pattern_Contacts_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"contacts", "id"}, "")) + pattern_Contacts_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"contacts", "id.resource_id"}, "")) pattern_Contacts_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"contacts"}, "")) diff --git a/pkg/pb/contacts.proto b/pkg/pb/contacts.proto index b806dd1..61f8f2d 100644 --- a/pkg/pb/contacts.proto +++ b/pkg/pb/contacts.proto @@ -8,6 +8,7 @@ import "github.com/lyft/protoc-gen-validate/validate/validate.proto"; import "protoc-gen-swagger/options/annotations.proto"; import "github.com/infobloxopen/protoc-gen-gorm/options/gorm.proto"; import "github.com/infobloxopen/protoc-gen-gorm/types/types.proto"; +import "github.com/infobloxopen/atlas-app-toolkit/rpc/resource/resource.proto"; option go_package = "github.com/infobloxopen/atlas-contacts-app/pkg/pb;pb"; @@ -16,7 +17,7 @@ message Profile { ormable: true, multi_account: true }; - uint64 id = 1; + atlas.rpc.Identifier id = 1 [(gorm.field).tag = {type: "serial"}]; string name = 2; string notes = 3; repeated Contact contacts = 4; @@ -32,7 +33,7 @@ message CreateProfileResponse { } message ReadProfileRequest { - uint64 id = 1; + atlas.rpc.Identifier id = 1; } message ReadProfileResponse { @@ -48,7 +49,7 @@ message UpdateProfileResponse { } message DeleteProfileRequest { - uint64 id = 1; + atlas.rpc.Identifier id = 1; } message ListProfilesResponse { @@ -66,20 +67,20 @@ service Profiles { rpc Read (ReadProfileRequest) returns (ReadProfileResponse) { option (google.api.http) = { - get: "/profiles/{id}" + get: "/profiles/{id.resource_id}" }; } rpc Update (UpdateProfileRequest) returns (UpdateProfileResponse) { option (google.api.http) = { - put: "/profiles/{payload.id}" + put: "/profiles/{payload.id.resource_id}" body: "payload" }; } rpc Delete (DeleteProfileRequest) returns (google.protobuf.Empty) { option (google.api.http) = { - delete: "/profiles/{id}" + delete: "/profiles/{id.resource_id}" }; option (gorm.method).object_type = "Profile"; } @@ -97,11 +98,11 @@ message Group { ormable: true, multi_account: true }; - uint64 id = 1; + atlas.rpc.Identifier id = 1 [(gorm.field).tag = {type: "serial"}]; string name = 2; string notes = 3; Profile profile = 4 [(gorm.field).belongs_to = {}]; - uint64 profile_id = 5; + atlas.rpc.Identifier profile_id = 5; repeated Contact contacts = 6 [(gorm.field).many_to_many = {}]; } @@ -114,7 +115,7 @@ message CreateGroupResponse { } message ReadGroupRequest { - uint64 id = 1; + atlas.rpc.Identifier id = 1; } message ReadGroupResponse { @@ -130,7 +131,7 @@ message UpdateGroupResponse { } message DeleteGroupRequest { - uint64 id = 1; + atlas.rpc.Identifier id = 1; } message ListGroupsResponse { @@ -148,20 +149,20 @@ service Groups { rpc Read (ReadGroupRequest) returns (ReadGroupResponse) { option (google.api.http) = { - get: "/groups/{id}" + get: "/groups/{id.resource_id}" }; } rpc Update (UpdateGroupRequest) returns (UpdateGroupResponse) { option (google.api.http) = { - put: "/groups/{payload.id}" + put: "/groups/{payload.id.resource_id}" body: "payload" }; } rpc Delete (DeleteGroupRequest) returns (google.protobuf.Empty) { option (google.api.http) = { - delete: "/groups/{id}" + delete: "/groups/{id.resource_id}" }; option (gorm.method).object_type = "Group"; } @@ -179,7 +180,7 @@ message Contact { ormable: true, multi_account: true }; - uint64 id = 1; + atlas.rpc.Identifier id = 1 [(gorm.field).tag = {type: "serial"}]; string first_name = 2; string middle_name = 3; string last_name = 4; @@ -188,7 +189,7 @@ message Contact { repeated Email emails = 8; Address home_address = 9; Address work_address = 10; - uint64 profile_id = 11; + atlas.rpc.Identifier profile_id = 11; Profile profile = 12 [(gorm.field).belongs_to = {}]; repeated Group groups = 13 [(gorm.field).many_to_many = {jointable: "group_contacts"}]; // nicknames is arbitrary json, but should be used for a list of strings @@ -227,7 +228,7 @@ message CreateContactResponse { } message ReadContactRequest { - uint64 id = 1; + atlas.rpc.Identifier id = 1; } message ReadContactResponse { @@ -243,7 +244,7 @@ message UpdateContactResponse { } message DeleteContactRequest { - uint64 id = 1; + atlas.rpc.Identifier id = 1; } message ListContactsResponse { @@ -266,20 +267,20 @@ service Contacts { rpc Read (ReadContactRequest) returns (ReadContactResponse) { option (google.api.http) = { - get: "/contacts/{id}" + get: "/contacts/{id.resource_id}" }; } rpc Update (UpdateContactRequest) returns (UpdateContactResponse) { option (google.api.http) = { - put: "/contacts/{payload.id}" + put: "/contacts/{payload.id.resource_id}" body: "payload" }; } rpc Delete (DeleteContactRequest) returns (google.protobuf.Empty) { option (google.api.http) = { - delete: "/contacts/{id}" + delete: "/contacts/{id.resource_id}" }; option (gorm.method).object_type = "Contact"; } diff --git a/pkg/svc/zserver.go b/pkg/svc/zserver.go index 0de936a..6a51517 100644 --- a/pkg/svc/zserver.go +++ b/pkg/svc/zserver.go @@ -14,8 +14,8 @@ import ( "fmt" - "github.com/infobloxopen/atlas-app-toolkit/gateway" "github.com/infobloxopen/atlas-app-toolkit/errors" + "github.com/infobloxopen/atlas-app-toolkit/gateway" "github.com/infobloxopen/atlas-app-toolkit/query" "github.com/infobloxopen/atlas-contacts-app/pkg/pb" "google.golang.org/grpc/codes"