go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/server/quota/quotapb/account.pb.go (about)

     1  // Copyright 2022 The LUCI Authors. All rights reserved.
     2  // Use of this source code is governed under the Apache License, Version 2.0
     3  // that can be found in the LICENSE file.
     4  
     5  // Code generated by protoc-gen-go. DO NOT EDIT.
     6  // versions:
     7  // 	protoc-gen-go v1.31.0
     8  // 	protoc        v3.21.7
     9  // source: go.chromium.org/luci/server/quota/quotapb/account.proto
    10  
    11  package quotapb
    12  
    13  import (
    14  	_ "github.com/envoyproxy/protoc-gen-validate/validate"
    15  	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
    16  	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
    17  	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
    18  	reflect "reflect"
    19  	sync "sync"
    20  )
    21  
    22  const (
    23  	// Verify that this generated code is sufficiently up-to-date.
    24  	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
    25  	// Verify that runtime/protoimpl is sufficiently up-to-date.
    26  	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
    27  )
    28  
    29  // An Account represents the current state of a single account.
    30  //
    31  // Note that a given user will have an account for each resource type in each
    32  // domain (realm, namespace) that they interact with. Each account tracks
    33  // exactly one balance.
    34  type Account struct {
    35  	state         protoimpl.MessageState
    36  	sizeCache     protoimpl.SizeCache
    37  	unknownFields protoimpl.UnknownFields
    38  
    39  	// The current numeric amount balance.
    40  	//
    41  	// NOTE: The odd-looking limits are because the current implementation uses
    42  	// Lua5.1 (embedded in Redis) for quota accounting, which stores numbers as
    43  	// doubles (making the maximum safe integer range only 53 bits). It would be
    44  	// possible to address this limit with some work. If you have a need of an
    45  	// account balance under/over these thresholds, please let us know.
    46  	Balance int64 `protobuf:"varint,1,opt,name=balance,proto3" json:"balance,omitempty"`
    47  	// The timestamp when the `balance` was last updated.
    48  	//
    49  	// This has microsecond accuracy (but note that refresh policies are only
    50  	// calculated at one-second resolution).
    51  	UpdatedTs *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=updated_ts,json=updatedTs,proto3" json:"updated_ts,omitempty"`
    52  	// The timestamp when this account's policy last changed.
    53  	//
    54  	// This has microsecond accuracy.
    55  	PolicyChangeTs *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=policy_change_ts,json=policyChangeTs,proto3" json:"policy_change_ts,omitempty"`
    56  	// The ref for the Policy which currently applies to this Account.
    57  	PolicyRef *PolicyRef `protobuf:"bytes,4,opt,name=policy_ref,json=policyRef,proto3" json:"policy_ref,omitempty"`
    58  	// Snapshot of the Policy which currently applies to this Account.
    59  	Policy *Policy `protobuf:"bytes,5,opt,name=policy,proto3" json:"policy,omitempty"`
    60  }
    61  
    62  func (x *Account) Reset() {
    63  	*x = Account{}
    64  	if protoimpl.UnsafeEnabled {
    65  		mi := &file_go_chromium_org_luci_server_quota_quotapb_account_proto_msgTypes[0]
    66  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    67  		ms.StoreMessageInfo(mi)
    68  	}
    69  }
    70  
    71  func (x *Account) String() string {
    72  	return protoimpl.X.MessageStringOf(x)
    73  }
    74  
    75  func (*Account) ProtoMessage() {}
    76  
    77  func (x *Account) ProtoReflect() protoreflect.Message {
    78  	mi := &file_go_chromium_org_luci_server_quota_quotapb_account_proto_msgTypes[0]
    79  	if protoimpl.UnsafeEnabled && x != nil {
    80  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    81  		if ms.LoadMessageInfo() == nil {
    82  			ms.StoreMessageInfo(mi)
    83  		}
    84  		return ms
    85  	}
    86  	return mi.MessageOf(x)
    87  }
    88  
    89  // Deprecated: Use Account.ProtoReflect.Descriptor instead.
    90  func (*Account) Descriptor() ([]byte, []int) {
    91  	return file_go_chromium_org_luci_server_quota_quotapb_account_proto_rawDescGZIP(), []int{0}
    92  }
    93  
    94  func (x *Account) GetBalance() int64 {
    95  	if x != nil {
    96  		return x.Balance
    97  	}
    98  	return 0
    99  }
   100  
   101  func (x *Account) GetUpdatedTs() *timestamppb.Timestamp {
   102  	if x != nil {
   103  		return x.UpdatedTs
   104  	}
   105  	return nil
   106  }
   107  
   108  func (x *Account) GetPolicyChangeTs() *timestamppb.Timestamp {
   109  	if x != nil {
   110  		return x.PolicyChangeTs
   111  	}
   112  	return nil
   113  }
   114  
   115  func (x *Account) GetPolicyRef() *PolicyRef {
   116  	if x != nil {
   117  		return x.PolicyRef
   118  	}
   119  	return nil
   120  }
   121  
   122  func (x *Account) GetPolicy() *Policy {
   123  	if x != nil {
   124  		return x.Policy
   125  	}
   126  	return nil
   127  }
   128  
   129  var File_go_chromium_org_luci_server_quota_quotapb_account_proto protoreflect.FileDescriptor
   130  
   131  var file_go_chromium_org_luci_server_quota_quotapb_account_proto_rawDesc = []byte{
   132  	0x0a, 0x37, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72,
   133  	0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x71, 0x75,
   134  	0x6f, 0x74, 0x61, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x70, 0x62, 0x2f, 0x61, 0x63, 0x63, 0x6f,
   135  	0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x29, 0x67, 0x6f, 0x2e, 0x63, 0x68,
   136  	0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x6c, 0x75, 0x63, 0x69, 0x2e,
   137  	0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x71, 0x75, 0x6f,
   138  	0x74, 0x61, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
   139  	0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e,
   140  	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f,
   141  	0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x33,
   142  	0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2f,
   143  	0x6c, 0x75, 0x63, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x71, 0x75, 0x6f, 0x74,
   144  	0x61, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x70, 0x62, 0x2f, 0x69, 0x64, 0x73, 0x2e, 0x70, 0x72,
   145  	0x6f, 0x74, 0x6f, 0x1a, 0x36, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d,
   146  	0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
   147  	0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x70, 0x62, 0x2f, 0x70,
   148  	0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x03, 0x0a, 0x07,
   149  	0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e,
   150  	0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x19, 0xfa, 0x42, 0x16, 0x22, 0x14, 0x18,
   151  	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x28, 0x81, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
   152  	0xf0, 0xff, 0x01, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0a,
   153  	0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
   154  	0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
   155  	0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42,
   156  	0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54,
   157  	0x73, 0x12, 0x4e, 0x0a, 0x10, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e,
   158  	0x67, 0x65, 0x5f, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
   159  	0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
   160  	0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08,
   161  	0x01, 0x52, 0x0e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54,
   162  	0x73, 0x12, 0x5d, 0x0a, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x66, 0x18,
   163  	0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d,
   164  	0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x6c, 0x75, 0x63, 0x69, 0x2e, 0x73, 0x65, 0x72,
   165  	0x76, 0x65, 0x72, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x70,
   166  	0x62, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x66, 0x42, 0x08, 0xfa, 0x42, 0x05,
   167  	0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x66,
   168  	0x12, 0x53, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b,
   169  	0x32, 0x31, 0x2e, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f,
   170  	0x72, 0x67, 0x2e, 0x6c, 0x75, 0x63, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x71,
   171  	0x75, 0x6f, 0x74, 0x61, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x70, 0x62, 0x2e, 0x50, 0x6f, 0x6c,
   172  	0x69, 0x63, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x70,
   173  	0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f,
   174  	0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x73, 0x65,
   175  	0x72, 0x76, 0x65, 0x72, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61,
   176  	0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
   177  }
   178  
   179  var (
   180  	file_go_chromium_org_luci_server_quota_quotapb_account_proto_rawDescOnce sync.Once
   181  	file_go_chromium_org_luci_server_quota_quotapb_account_proto_rawDescData = file_go_chromium_org_luci_server_quota_quotapb_account_proto_rawDesc
   182  )
   183  
   184  func file_go_chromium_org_luci_server_quota_quotapb_account_proto_rawDescGZIP() []byte {
   185  	file_go_chromium_org_luci_server_quota_quotapb_account_proto_rawDescOnce.Do(func() {
   186  		file_go_chromium_org_luci_server_quota_quotapb_account_proto_rawDescData = protoimpl.X.CompressGZIP(file_go_chromium_org_luci_server_quota_quotapb_account_proto_rawDescData)
   187  	})
   188  	return file_go_chromium_org_luci_server_quota_quotapb_account_proto_rawDescData
   189  }
   190  
   191  var file_go_chromium_org_luci_server_quota_quotapb_account_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
   192  var file_go_chromium_org_luci_server_quota_quotapb_account_proto_goTypes = []interface{}{
   193  	(*Account)(nil),               // 0: go.chromium.org.luci.server.quota.quotapb.Account
   194  	(*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp
   195  	(*PolicyRef)(nil),             // 2: go.chromium.org.luci.server.quota.quotapb.PolicyRef
   196  	(*Policy)(nil),                // 3: go.chromium.org.luci.server.quota.quotapb.Policy
   197  }
   198  var file_go_chromium_org_luci_server_quota_quotapb_account_proto_depIdxs = []int32{
   199  	1, // 0: go.chromium.org.luci.server.quota.quotapb.Account.updated_ts:type_name -> google.protobuf.Timestamp
   200  	1, // 1: go.chromium.org.luci.server.quota.quotapb.Account.policy_change_ts:type_name -> google.protobuf.Timestamp
   201  	2, // 2: go.chromium.org.luci.server.quota.quotapb.Account.policy_ref:type_name -> go.chromium.org.luci.server.quota.quotapb.PolicyRef
   202  	3, // 3: go.chromium.org.luci.server.quota.quotapb.Account.policy:type_name -> go.chromium.org.luci.server.quota.quotapb.Policy
   203  	4, // [4:4] is the sub-list for method output_type
   204  	4, // [4:4] is the sub-list for method input_type
   205  	4, // [4:4] is the sub-list for extension type_name
   206  	4, // [4:4] is the sub-list for extension extendee
   207  	0, // [0:4] is the sub-list for field type_name
   208  }
   209  
   210  func init() { file_go_chromium_org_luci_server_quota_quotapb_account_proto_init() }
   211  func file_go_chromium_org_luci_server_quota_quotapb_account_proto_init() {
   212  	if File_go_chromium_org_luci_server_quota_quotapb_account_proto != nil {
   213  		return
   214  	}
   215  	file_go_chromium_org_luci_server_quota_quotapb_ids_proto_init()
   216  	file_go_chromium_org_luci_server_quota_quotapb_policy_proto_init()
   217  	if !protoimpl.UnsafeEnabled {
   218  		file_go_chromium_org_luci_server_quota_quotapb_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
   219  			switch v := v.(*Account); i {
   220  			case 0:
   221  				return &v.state
   222  			case 1:
   223  				return &v.sizeCache
   224  			case 2:
   225  				return &v.unknownFields
   226  			default:
   227  				return nil
   228  			}
   229  		}
   230  	}
   231  	type x struct{}
   232  	out := protoimpl.TypeBuilder{
   233  		File: protoimpl.DescBuilder{
   234  			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
   235  			RawDescriptor: file_go_chromium_org_luci_server_quota_quotapb_account_proto_rawDesc,
   236  			NumEnums:      0,
   237  			NumMessages:   1,
   238  			NumExtensions: 0,
   239  			NumServices:   0,
   240  		},
   241  		GoTypes:           file_go_chromium_org_luci_server_quota_quotapb_account_proto_goTypes,
   242  		DependencyIndexes: file_go_chromium_org_luci_server_quota_quotapb_account_proto_depIdxs,
   243  		MessageInfos:      file_go_chromium_org_luci_server_quota_quotapb_account_proto_msgTypes,
   244  	}.Build()
   245  	File_go_chromium_org_luci_server_quota_quotapb_account_proto = out.File
   246  	file_go_chromium_org_luci_server_quota_quotapb_account_proto_rawDesc = nil
   247  	file_go_chromium_org_luci_server_quota_quotapb_account_proto_goTypes = nil
   248  	file_go_chromium_org_luci_server_quota_quotapb_account_proto_depIdxs = nil
   249  }