mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
Go 3166 (#201)
* Change GetTiersResponse * Locale -> Language * Revert locale -> language
This commit is contained in:
parent
ec754f11b8
commit
e2866e9340
2 changed files with 114 additions and 269 deletions
|
@ -60,13 +60,7 @@ func (PeriodType) EnumDescriptor() ([]byte, []int) {
|
|||
}
|
||||
|
||||
type Feature struct {
|
||||
// "invites"
|
||||
// "GBs"
|
||||
// "spaces"
|
||||
// ...
|
||||
ValueStr string `protobuf:"bytes,1,opt,name=valueStr,proto3" json:"valueStr,omitempty"`
|
||||
// each uint is a value of the feature
|
||||
ValueUint uint32 `protobuf:"varint,2,opt,name=valueUint,proto3" json:"valueUint,omitempty"`
|
||||
Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Feature) Reset() { *m = Feature{} }
|
||||
|
@ -102,27 +96,18 @@ func (m *Feature) XXX_DiscardUnknown() {
|
|||
|
||||
var xxx_messageInfo_Feature proto.InternalMessageInfo
|
||||
|
||||
func (m *Feature) GetValueStr() string {
|
||||
func (m *Feature) GetDescription() string {
|
||||
if m != nil {
|
||||
return m.ValueStr
|
||||
return m.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Feature) GetValueUint() uint32 {
|
||||
if m != nil {
|
||||
return m.ValueUint
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetTiersRequest struct {
|
||||
// in the following format: "A5k2d9sFZw84yisTxRnz2bPRd1YPfVfhxqymZ6yESprFTG65"
|
||||
// you can get it with Account().SignKey.GetPublic().Account()
|
||||
OwnerAnyId string `protobuf:"bytes,1,opt,name=ownerAnyId,proto3" json:"ownerAnyId,omitempty"`
|
||||
Locale string `protobuf:"bytes,2,opt,name=locale,proto3" json:"locale,omitempty"`
|
||||
// see PaymentMethod enum
|
||||
PaymentMethod uint32 `protobuf:"varint,3,opt,name=paymentMethod,proto3" json:"paymentMethod,omitempty"`
|
||||
}
|
||||
|
||||
func (m *GetTiersRequest) Reset() { *m = GetTiersRequest{} }
|
||||
|
@ -172,13 +157,6 @@ func (m *GetTiersRequest) GetLocale() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
func (m *GetTiersRequest) GetPaymentMethod() uint32 {
|
||||
if m != nil {
|
||||
return m.PaymentMethod
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetTiersRequestSigned struct {
|
||||
// GetTiersRequest struct
|
||||
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
|
||||
|
@ -261,9 +239,9 @@ type TierData struct {
|
|||
// somename.any - len of 8
|
||||
AnyNameMinLength uint32 `protobuf:"varint,11,opt,name=anyNameMinLength,proto3" json:"anyNameMinLength,omitempty"`
|
||||
// each tier has a set of features
|
||||
// each feature has a unique key: "storage", "invites", etc
|
||||
// not using enum here to provide dynamic feature list
|
||||
Features map[string]*Feature `protobuf:"bytes,12,rep,name=features,proto3" json:"features,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
Features []*Feature `protobuf:"bytes,12,rep,name=features,proto3" json:"features,omitempty"`
|
||||
// green, blue, red, purple or custom color in string format #ff00ff
|
||||
ColorStr string `protobuf:"bytes,13,opt,name=colorStr,proto3" json:"colorStr,omitempty"`
|
||||
}
|
||||
|
||||
func (m *TierData) Reset() { *m = TierData{} }
|
||||
|
@ -376,13 +354,20 @@ func (m *TierData) GetAnyNameMinLength() uint32 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (m *TierData) GetFeatures() map[string]*Feature {
|
||||
func (m *TierData) GetFeatures() []*Feature {
|
||||
if m != nil {
|
||||
return m.Features
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TierData) GetColorStr() string {
|
||||
if m != nil {
|
||||
return m.ColorStr
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetTiersResponse struct {
|
||||
// list of all available tiers
|
||||
Tiers []*TierData `protobuf:"bytes,1,rep,name=tiers,proto3" json:"tiers,omitempty"`
|
||||
|
@ -434,7 +419,6 @@ func init() {
|
|||
proto.RegisterType((*GetTiersRequest)(nil), "GetTiersRequest")
|
||||
proto.RegisterType((*GetTiersRequestSigned)(nil), "GetTiersRequestSigned")
|
||||
proto.RegisterType((*TierData)(nil), "TierData")
|
||||
proto.RegisterMapType((map[string]*Feature)(nil), "TierData.FeaturesEntry")
|
||||
proto.RegisterType((*GetTiersResponse)(nil), "GetTiersResponse")
|
||||
}
|
||||
|
||||
|
@ -443,46 +427,42 @@ func init() {
|
|||
}
|
||||
|
||||
var fileDescriptor_597ac3048c641f44 = []byte{
|
||||
// 615 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x94, 0xcf, 0x4f, 0xdb, 0x4a,
|
||||
0x10, 0xc7, 0xe3, 0xfc, 0x80, 0x64, 0x92, 0x80, 0xdf, 0xf0, 0x78, 0xac, 0xd0, 0x93, 0x5f, 0x64,
|
||||
0xbd, 0x43, 0x44, 0xa5, 0x50, 0x41, 0x0f, 0x55, 0xd5, 0x0b, 0x05, 0xda, 0x22, 0x95, 0xb6, 0x5a,
|
||||
0xa0, 0x55, 0x7b, 0xa9, 0xb6, 0xf1, 0x14, 0x56, 0x24, 0xbb, 0xae, 0x77, 0x03, 0xf2, 0x5f, 0xd0,
|
||||
0x2b, 0x7f, 0x56, 0x8f, 0x1c, 0x7b, 0xac, 0xe0, 0x1f, 0xa9, 0xbc, 0x71, 0xe2, 0x84, 0x22, 0xf5,
|
||||
0x92, 0xec, 0xf7, 0xf3, 0xdd, 0x9d, 0x9d, 0xf1, 0x8c, 0x0d, 0x7b, 0xb1, 0x48, 0x87, 0xa4, 0xac,
|
||||
0xa1, 0xe4, 0x42, 0xf6, 0x69, 0x73, 0x5e, 0xc6, 0x89, 0xb6, 0x7a, 0xd3, 0xf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e7, 0x94, 0xe6, 0xb3, 0x97, 0x2d, 0x31, 0x80,
|
||||
0x9a, 0x1b, 0x5a, 0xd7, 0xc9, 0xe6, 0x56, 0x7d, 0x12, 0x8b, 0x8f, 0xf1, 0x93, 0xf2, 0x63, 0x2f,
|
||||
0xdc, 0x06, 0xbf, 0x18, 0x2d, 0x13, 0x6b, 0x65, 0x08, 0xff, 0x83, 0x9a, 0x7b, 0x67, 0x98, 0xe7,
|
||||
0x92, 0x69, 0x4c, 0x93, 0xe1, 0x63, 0xbe, 0x71, 0xe5, 0x01, 0x14, 0x1d, 0xc0, 0x55, 0xf8, 0xab,
|
||||
0x50, 0x27, 0xea, 0x5c, 0xe9, 0x4b, 0xe5, 0x97, 0x70, 0x0d, 0x56, 0x66, 0xf1, 0x40, 0x0e, 0xa5,
|
||||
0xa5, 0xc8, 0xf7, 0x10, 0x61, 0xa9, 0x30, 0xf6, 0x44, 0x6a, 0xfc, 0x32, 0xae, 0xc0, 0x72, 0xc1,
|
||||
0xde, 0x13, 0x9d, 0x1b, 0xbf, 0x82, 0x7f, 0x83, 0x5f, 0xc0, 0x43, 0xad, 0xec, 0x99, 0xf1, 0xab,
|
||||
0xf3, 0x5b, 0x3f, 0x90, 0x48, 0x8c, 0x5f, 0x7b, 0xf6, 0xf4, 0xfb, 0x4d, 0xe0, 0x5d, 0xdf, 0x04,
|
||||
0xde, 0xcf, 0x9b, 0xc0, 0xbb, 0xba, 0x0d, 0x4a, 0xd7, 0xb7, 0x41, 0xe9, 0xc7, 0x6d, 0x50, 0xfa,
|
||||
0x18, 0xfe, 0xf9, 0xc3, 0xf1, 0x79, 0xc1, 0xfd, 0x6d, 0xff, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x0a,
|
||||
0xee, 0x4f, 0x49, 0x65, 0x04, 0x00, 0x00,
|
||||
// 549 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x4d, 0x6f, 0xd3, 0x4c,
|
||||
0x10, 0xc7, 0xe3, 0xa4, 0x2f, 0xce, 0x24, 0x6d, 0xfd, 0x6c, 0x9f, 0xc2, 0x0a, 0x21, 0x13, 0x59,
|
||||
0x1c, 0xa2, 0x56, 0x4a, 0x51, 0xcb, 0x91, 0x4b, 0x69, 0x04, 0x44, 0xa2, 0x80, 0x9c, 0x14, 0x04,
|
||||
0x17, 0xb4, 0xd8, 0x43, 0xba, 0xaa, 0xb3, 0x6b, 0x76, 0x37, 0xad, 0xfc, 0x2d, 0xfa, 0xb1, 0xb8,
|
||||
0x20, 0xf5, 0xc8, 0x11, 0x25, 0x5f, 0x04, 0x79, 0xf3, 0xe2, 0x24, 0xad, 0xc4, 0xc5, 0xf6, 0xff,
|
||||
0xff, 0xdb, 0x19, 0xcd, 0xcc, 0x8e, 0xa1, 0x9d, 0xb2, 0x6c, 0x80, 0xc2, 0x68, 0x54, 0x57, 0x3c,
|
||||
0xc2, 0xc3, 0x65, 0x99, 0x2a, 0x69, 0xe4, 0xa1, 0x7d, 0xea, 0x15, 0xf4, 0xd5, 0x70, 0x54, 0xba,
|
||||
0x65, 0x59, 0x70, 0x00, 0x9b, 0xaf, 0x90, 0x99, 0xa1, 0x42, 0xd2, 0x80, 0x5a, 0x8c, 0x3a, 0x52,
|
||||
0x3c, 0x35, 0x5c, 0x0a, 0xea, 0x34, 0x9c, 0x66, 0x35, 0x5c, 0xb4, 0x82, 0x0e, 0xec, 0xbc, 0x46,
|
||||
0xd3, 0xcb, 0xc3, 0x43, 0xfc, 0x31, 0x44, 0x6d, 0x88, 0x0f, 0x20, 0xaf, 0x05, 0xaa, 0x13, 0x91,
|
||||
0x75, 0xe2, 0x69, 0xcc, 0x82, 0x43, 0x1e, 0xc0, 0x46, 0x22, 0x23, 0x96, 0x20, 0x2d, 0x5b, 0x36,
|
||||
0x55, 0xc1, 0x7b, 0xd8, 0x5b, 0x49, 0xd5, 0xe5, 0x7d, 0x81, 0x31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d, 0x1d, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xc4, 0x11,
|
||||
0x59, 0xed, 0x03, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Feature) Marshal() (dAtA []byte, err error) {
|
||||
|
@ -505,15 +485,10 @@ func (m *Feature) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.ValueUint != 0 {
|
||||
i = encodeVarintPaymentserviceTiers(dAtA, i, uint64(m.ValueUint))
|
||||
i--
|
||||
dAtA[i] = 0x10
|
||||
}
|
||||
if len(m.ValueStr) > 0 {
|
||||
i -= len(m.ValueStr)
|
||||
copy(dAtA[i:], m.ValueStr)
|
||||
i = encodeVarintPaymentserviceTiers(dAtA, i, uint64(len(m.ValueStr)))
|
||||
if len(m.Description) > 0 {
|
||||
i -= len(m.Description)
|
||||
copy(dAtA[i:], m.Description)
|
||||
i = encodeVarintPaymentserviceTiers(dAtA, i, uint64(len(m.Description)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
|
@ -540,11 +515,6 @@ func (m *GetTiersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.PaymentMethod != 0 {
|
||||
i = encodeVarintPaymentserviceTiers(dAtA, i, uint64(m.PaymentMethod))
|
||||
i--
|
||||
dAtA[i] = 0x18
|
||||
}
|
||||
if len(m.Locale) > 0 {
|
||||
i -= len(m.Locale)
|
||||
copy(dAtA[i:], m.Locale)
|
||||
|
@ -619,28 +589,23 @@ func (m *TierData) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.ColorStr) > 0 {
|
||||
i -= len(m.ColorStr)
|
||||
copy(dAtA[i:], m.ColorStr)
|
||||
i = encodeVarintPaymentserviceTiers(dAtA, i, uint64(len(m.ColorStr)))
|
||||
i--
|
||||
dAtA[i] = 0x6a
|
||||
}
|
||||
if len(m.Features) > 0 {
|
||||
for k := range m.Features {
|
||||
v := m.Features[k]
|
||||
baseI := i
|
||||
if v != nil {
|
||||
{
|
||||
size, err := v.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintPaymentserviceTiers(dAtA, i, uint64(size))
|
||||
for iNdEx := len(m.Features) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Features[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
i -= size
|
||||
i = encodeVarintPaymentserviceTiers(dAtA, i, uint64(size))
|
||||
}
|
||||
i -= len(k)
|
||||
copy(dAtA[i:], k)
|
||||
i = encodeVarintPaymentserviceTiers(dAtA, i, uint64(len(k)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
i = encodeVarintPaymentserviceTiers(dAtA, i, uint64(baseI-i))
|
||||
i--
|
||||
dAtA[i] = 0x62
|
||||
}
|
||||
|
@ -776,13 +741,10 @@ func (m *Feature) Size() (n int) {
|
|||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.ValueStr)
|
||||
l = len(m.Description)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovPaymentserviceTiers(uint64(l))
|
||||
}
|
||||
if m.ValueUint != 0 {
|
||||
n += 1 + sovPaymentserviceTiers(uint64(m.ValueUint))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
|
@ -800,9 +762,6 @@ func (m *GetTiersRequest) Size() (n int) {
|
|||
if l > 0 {
|
||||
n += 1 + l + sovPaymentserviceTiers(uint64(l))
|
||||
}
|
||||
if m.PaymentMethod != 0 {
|
||||
n += 1 + sovPaymentserviceTiers(uint64(m.PaymentMethod))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
|
@ -865,18 +824,15 @@ func (m *TierData) Size() (n int) {
|
|||
n += 1 + sovPaymentserviceTiers(uint64(m.AnyNameMinLength))
|
||||
}
|
||||
if len(m.Features) > 0 {
|
||||
for k, v := range m.Features {
|
||||
_ = k
|
||||
_ = v
|
||||
l = 0
|
||||
if v != nil {
|
||||
l = v.Size()
|
||||
l += 1 + sovPaymentserviceTiers(uint64(l))
|
||||
}
|
||||
mapEntrySize := 1 + len(k) + sovPaymentserviceTiers(uint64(len(k))) + l
|
||||
n += mapEntrySize + 1 + sovPaymentserviceTiers(uint64(mapEntrySize))
|
||||
for _, e := range m.Features {
|
||||
l = e.Size()
|
||||
n += 1 + l + sovPaymentserviceTiers(uint64(l))
|
||||
}
|
||||
}
|
||||
l = len(m.ColorStr)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovPaymentserviceTiers(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
|
@ -932,7 +888,7 @@ func (m *Feature) Unmarshal(dAtA []byte) error {
|
|||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ValueStr", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
|
@ -960,27 +916,8 @@ func (m *Feature) Unmarshal(dAtA []byte) error {
|
|||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.ValueStr = string(dAtA[iNdEx:postIndex])
|
||||
m.Description = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ValueUint", wireType)
|
||||
}
|
||||
m.ValueUint = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowPaymentserviceTiers
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.ValueUint |= uint32(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipPaymentserviceTiers(dAtA[iNdEx:])
|
||||
|
@ -1095,25 +1032,6 @@ func (m *GetTiersRequest) Unmarshal(dAtA []byte) error {
|
|||
}
|
||||
m.Locale = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field PaymentMethod", wireType)
|
||||
}
|
||||
m.PaymentMethod = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowPaymentserviceTiers
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.PaymentMethod |= uint32(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipPaymentserviceTiers(dAtA[iNdEx:])
|
||||
|
@ -1549,105 +1467,42 @@ func (m *TierData) Unmarshal(dAtA []byte) error {
|
|||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Features == nil {
|
||||
m.Features = make(map[string]*Feature)
|
||||
m.Features = append(m.Features, &Feature{})
|
||||
if err := m.Features[len(m.Features)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
var mapkey string
|
||||
var mapvalue *Feature
|
||||
for iNdEx < postIndex {
|
||||
entryPreIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowPaymentserviceTiers
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 13:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ColorStr", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowPaymentserviceTiers
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
if fieldNum == 1 {
|
||||
var stringLenmapkey uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowPaymentserviceTiers
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLenmapkey |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLenmapkey := int(stringLenmapkey)
|
||||
if intStringLenmapkey < 0 {
|
||||
return ErrInvalidLengthPaymentserviceTiers
|
||||
}
|
||||
postStringIndexmapkey := iNdEx + intStringLenmapkey
|
||||
if postStringIndexmapkey < 0 {
|
||||
return ErrInvalidLengthPaymentserviceTiers
|
||||
}
|
||||
if postStringIndexmapkey > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
|
||||
iNdEx = postStringIndexmapkey
|
||||
} else if fieldNum == 2 {
|
||||
var mapmsglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowPaymentserviceTiers
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
mapmsglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if mapmsglen < 0 {
|
||||
return ErrInvalidLengthPaymentserviceTiers
|
||||
}
|
||||
postmsgIndex := iNdEx + mapmsglen
|
||||
if postmsgIndex < 0 {
|
||||
return ErrInvalidLengthPaymentserviceTiers
|
||||
}
|
||||
if postmsgIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
mapvalue = &Feature{}
|
||||
if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postmsgIndex
|
||||
} else {
|
||||
iNdEx = entryPreIndex
|
||||
skippy, err := skipPaymentserviceTiers(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthPaymentserviceTiers
|
||||
}
|
||||
if (iNdEx + skippy) > postIndex {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
m.Features[mapkey] = mapvalue
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthPaymentserviceTiers
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthPaymentserviceTiers
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.ColorStr = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
|
|
|
@ -12,14 +12,7 @@ enum PeriodType {
|
|||
}
|
||||
|
||||
message Feature {
|
||||
// "invites"
|
||||
// "GBs"
|
||||
// "spaces"
|
||||
// ...
|
||||
string valueStr = 1;
|
||||
|
||||
// each uint is a value of the feature
|
||||
uint32 valueUint = 2;
|
||||
string description = 1;
|
||||
}
|
||||
|
||||
message GetTiersRequest {
|
||||
|
@ -28,9 +21,6 @@ message GetTiersRequest {
|
|||
string ownerAnyId = 1;
|
||||
|
||||
string locale = 2;
|
||||
|
||||
// see PaymentMethod enum
|
||||
uint32 paymentMethod = 3;
|
||||
}
|
||||
|
||||
message GetTiersRequestSigned {
|
||||
|
@ -68,9 +58,9 @@ message TierData {
|
|||
// somename.any - len of 8
|
||||
uint32 anyNameMinLength = 11;
|
||||
// each tier has a set of features
|
||||
// each feature has a unique key: "storage", "invites", etc
|
||||
// not using enum here to provide dynamic feature list
|
||||
map<string, Feature> features = 12;
|
||||
repeated Feature features = 12;
|
||||
// green, blue, red, purple or custom color in string format #ff00ff
|
||||
string colorStr = 13;
|
||||
}
|
||||
|
||||
message GetTiersResponse {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue