From 9deb15ff68ad654a64550d1d28105c1806c333c2 Mon Sep 17 00:00:00 2001 From: igooch Date: Mon, 11 Sep 2023 14:27:39 -0700 Subject: [PATCH] Implements GetCounter and UpdateCounter on the SDK Server (#3322) * Implements GetCounter and UpdateCounter on the SDK Server * Adds UpdateCounter SDKServer test * Changes Update Counter Request to batch and validate in the SDK * Cleans up duplicate code in sdkserver updateCounter * Adds a cached version of the GameServer to the SDK If the GameServer has been successfully updated by the client in the updateCounter this updated version is stored in the SDK. If the s.gameServer() is called and the Generation of the gameServer is less than (older than) the version stored in the SDK, then the SDK version is returned. * Removes the diffList for counterUpdateRequest The diff will be a single aggregated number that may be truncated if final Count of the Counter would be less than zero or greater than capacity. This means a request to increment or decrement a Counter may only be partially applied. * Adds logic to allow for decrementing the Count even when Count is greater than Capacity after decrementation Also adds tests. * More tests for updateCounter * Removes UpdateCounter from the LocalSDK This logic followed a previous version of the proto for UpdateCounter. * Adds in debug logs for when the UpdateCounter request truncates requests * Generated Files * Removes file that should no longer be generated * Changes per review comments Largest change is to truncate any existing Count to the Capacity, so that Count is always less than or equal to Capacity on any change. * Removing unused swagger model * Generated files * Minor updates per review comments * Updates error messages to follow the Google Style Guide * Adds debug log for flaky TestGameServerResourceValidation --- pkg/sdk/alpha/alpha.pb.go | 565 ++++++++++------- pkg/sdk/alpha/alpha.pb.gw.go | 58 +- pkg/sdk/alpha/alpha_grpc.pb.go | 8 +- pkg/sdk/beta/beta.pb.go | 2 +- pkg/sdk/beta/beta_grpc.pb.go | 2 +- pkg/sdk/sdk.pb.go | 2 +- pkg/sdk/sdk_grpc.pb.go | 2 +- pkg/sdkserver/localsdk.go | 52 +- pkg/sdkserver/localsdk_test.go | 190 ------ pkg/sdkserver/sdkserver.go | 232 ++++++- pkg/sdkserver/sdkserver_test.go | 236 +++++++ proto/sdk/alpha/alpha.proto | 38 +- sdks/csharp/sdk/generated/Alpha.cs | 577 +++++++++++++----- sdks/csharp/sdk/generated/AlphaGrpc.cs | 15 - sdks/nodejs/lib/alpha/alpha_grpc_pb.js | 4 +- sdks/nodejs/lib/alpha/alpha_pb.js | 369 +++++++++-- sdks/rust/proto/sdk/alpha/alpha.proto | 38 +- sdks/swagger/alpha.swagger.json | 50 +- test/e2e/gameserver_test.go | 2 + test/sdk/restapi/alpha/swagger/api_sdk.go | 12 +- .../model_alpha_counter_update_request.go | 32 + ...equested_update_to_make_to_the_counter.go} | 3 +- 22 files changed, 1673 insertions(+), 816 deletions(-) create mode 100644 test/sdk/restapi/alpha/swagger/model_alpha_counter_update_request.go rename test/sdk/restapi/alpha/swagger/{model_the_counter_to_update.go => model_the_requested_update_to_make_to_the_counter.go} (91%) diff --git a/pkg/sdk/alpha/alpha.pb.go b/pkg/sdk/alpha/alpha.pb.go index 9077961e42..e9139b44ad 100644 --- a/pkg/sdk/alpha/alpha.pb.go +++ b/pkg/sdk/alpha/alpha.pb.go @@ -30,7 +30,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.6 +// protoc v3.21.12 // source: alpha.proto package alpha @@ -45,6 +45,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" _ "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" ) const ( @@ -352,6 +353,83 @@ func (x *Counter) GetCapacity() int64 { return 0 } +// A representation of a Counter Update Request. +type CounterUpdateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the Counter to update + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The value to set the Counter Count + Count *wrapperspb.Int64Value `protobuf:"bytes,2,opt,name=count,proto3" json:"count,omitempty"` + // The value to set the Counter Capacity + Capacity *wrapperspb.Int64Value `protobuf:"bytes,3,opt,name=capacity,proto3" json:"capacity,omitempty"` + // countDiff tracks if a Counter Update Request is CountIncrement (positive), CountDecrement + // (negative), 0 if a CountSet or CapacitySet request + CountDiff int64 `protobuf:"varint,4,opt,name=countDiff,proto3" json:"countDiff,omitempty"` +} + +func (x *CounterUpdateRequest) Reset() { + *x = CounterUpdateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_alpha_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CounterUpdateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CounterUpdateRequest) ProtoMessage() {} + +func (x *CounterUpdateRequest) ProtoReflect() protoreflect.Message { + mi := &file_alpha_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CounterUpdateRequest.ProtoReflect.Descriptor instead. +func (*CounterUpdateRequest) Descriptor() ([]byte, []int) { + return file_alpha_proto_rawDescGZIP(), []int{6} +} + +func (x *CounterUpdateRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CounterUpdateRequest) GetCount() *wrapperspb.Int64Value { + if x != nil { + return x.Count + } + return nil +} + +func (x *CounterUpdateRequest) GetCapacity() *wrapperspb.Int64Value { + if x != nil { + return x.Capacity + } + return nil +} + +func (x *CounterUpdateRequest) GetCountDiff() int64 { + if x != nil { + return x.CountDiff + } + return 0 +} + type GetCounterRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -364,7 +442,7 @@ type GetCounterRequest struct { func (x *GetCounterRequest) Reset() { *x = GetCounterRequest{} if protoimpl.UnsafeEnabled { - mi := &file_alpha_proto_msgTypes[6] + mi := &file_alpha_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -377,7 +455,7 @@ func (x *GetCounterRequest) String() string { func (*GetCounterRequest) ProtoMessage() {} func (x *GetCounterRequest) ProtoReflect() protoreflect.Message { - mi := &file_alpha_proto_msgTypes[6] + mi := &file_alpha_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -390,7 +468,7 @@ func (x *GetCounterRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCounterRequest.ProtoReflect.Descriptor instead. func (*GetCounterRequest) Descriptor() ([]byte, []int) { - return file_alpha_proto_rawDescGZIP(), []int{6} + return file_alpha_proto_rawDescGZIP(), []int{7} } func (x *GetCounterRequest) GetName() string { @@ -405,18 +483,14 @@ type UpdateCounterRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The Counter to update - Counter *Counter `protobuf:"bytes,1,opt,name=counter,proto3" json:"counter,omitempty"` - // Required. Mask (list) of fields to update. - // Fields are specified relative to the Counter - // (e.g. `count`, `capacity`; *not* `Counter.count` or `Counter.capacity`). - UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + // The requested update to make to the Counter + CounterUpdateRequest *CounterUpdateRequest `protobuf:"bytes,1,opt,name=counterUpdateRequest,proto3" json:"counterUpdateRequest,omitempty"` } func (x *UpdateCounterRequest) Reset() { *x = UpdateCounterRequest{} if protoimpl.UnsafeEnabled { - mi := &file_alpha_proto_msgTypes[7] + mi := &file_alpha_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -429,7 +503,7 @@ func (x *UpdateCounterRequest) String() string { func (*UpdateCounterRequest) ProtoMessage() {} func (x *UpdateCounterRequest) ProtoReflect() protoreflect.Message { - mi := &file_alpha_proto_msgTypes[7] + mi := &file_alpha_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -442,19 +516,12 @@ func (x *UpdateCounterRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateCounterRequest.ProtoReflect.Descriptor instead. func (*UpdateCounterRequest) Descriptor() ([]byte, []int) { - return file_alpha_proto_rawDescGZIP(), []int{7} -} - -func (x *UpdateCounterRequest) GetCounter() *Counter { - if x != nil { - return x.Counter - } - return nil + return file_alpha_proto_rawDescGZIP(), []int{8} } -func (x *UpdateCounterRequest) GetUpdateMask() *fieldmaskpb.FieldMask { +func (x *UpdateCounterRequest) GetCounterUpdateRequest() *CounterUpdateRequest { if x != nil { - return x.UpdateMask + return x.CounterUpdateRequest } return nil } @@ -476,7 +543,7 @@ type List struct { func (x *List) Reset() { *x = List{} if protoimpl.UnsafeEnabled { - mi := &file_alpha_proto_msgTypes[8] + mi := &file_alpha_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -489,7 +556,7 @@ func (x *List) String() string { func (*List) ProtoMessage() {} func (x *List) ProtoReflect() protoreflect.Message { - mi := &file_alpha_proto_msgTypes[8] + mi := &file_alpha_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -502,7 +569,7 @@ func (x *List) ProtoReflect() protoreflect.Message { // Deprecated: Use List.ProtoReflect.Descriptor instead. func (*List) Descriptor() ([]byte, []int) { - return file_alpha_proto_rawDescGZIP(), []int{8} + return file_alpha_proto_rawDescGZIP(), []int{9} } func (x *List) GetName() string { @@ -538,7 +605,7 @@ type GetListRequest struct { func (x *GetListRequest) Reset() { *x = GetListRequest{} if protoimpl.UnsafeEnabled { - mi := &file_alpha_proto_msgTypes[9] + mi := &file_alpha_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -551,7 +618,7 @@ func (x *GetListRequest) String() string { func (*GetListRequest) ProtoMessage() {} func (x *GetListRequest) ProtoReflect() protoreflect.Message { - mi := &file_alpha_proto_msgTypes[9] + mi := &file_alpha_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -564,7 +631,7 @@ func (x *GetListRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetListRequest.ProtoReflect.Descriptor instead. func (*GetListRequest) Descriptor() ([]byte, []int) { - return file_alpha_proto_rawDescGZIP(), []int{9} + return file_alpha_proto_rawDescGZIP(), []int{10} } func (x *GetListRequest) GetName() string { @@ -590,7 +657,7 @@ type UpdateListRequest struct { func (x *UpdateListRequest) Reset() { *x = UpdateListRequest{} if protoimpl.UnsafeEnabled { - mi := &file_alpha_proto_msgTypes[10] + mi := &file_alpha_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -603,7 +670,7 @@ func (x *UpdateListRequest) String() string { func (*UpdateListRequest) ProtoMessage() {} func (x *UpdateListRequest) ProtoReflect() protoreflect.Message { - mi := &file_alpha_proto_msgTypes[10] + mi := &file_alpha_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -616,7 +683,7 @@ func (x *UpdateListRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateListRequest.ProtoReflect.Descriptor instead. func (*UpdateListRequest) Descriptor() ([]byte, []int) { - return file_alpha_proto_rawDescGZIP(), []int{10} + return file_alpha_proto_rawDescGZIP(), []int{11} } func (x *UpdateListRequest) GetList() *List { @@ -646,7 +713,7 @@ type AddListValueRequest struct { func (x *AddListValueRequest) Reset() { *x = AddListValueRequest{} if protoimpl.UnsafeEnabled { - mi := &file_alpha_proto_msgTypes[11] + mi := &file_alpha_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -659,7 +726,7 @@ func (x *AddListValueRequest) String() string { func (*AddListValueRequest) ProtoMessage() {} func (x *AddListValueRequest) ProtoReflect() protoreflect.Message { - mi := &file_alpha_proto_msgTypes[11] + mi := &file_alpha_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -672,7 +739,7 @@ func (x *AddListValueRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddListValueRequest.ProtoReflect.Descriptor instead. func (*AddListValueRequest) Descriptor() ([]byte, []int) { - return file_alpha_proto_rawDescGZIP(), []int{11} + return file_alpha_proto_rawDescGZIP(), []int{12} } func (x *AddListValueRequest) GetName() string { @@ -702,7 +769,7 @@ type RemoveListValueRequest struct { func (x *RemoveListValueRequest) Reset() { *x = RemoveListValueRequest{} if protoimpl.UnsafeEnabled { - mi := &file_alpha_proto_msgTypes[12] + mi := &file_alpha_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -715,7 +782,7 @@ func (x *RemoveListValueRequest) String() string { func (*RemoveListValueRequest) ProtoMessage() {} func (x *RemoveListValueRequest) ProtoReflect() protoreflect.Message { - mi := &file_alpha_proto_msgTypes[12] + mi := &file_alpha_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -728,7 +795,7 @@ func (x *RemoveListValueRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveListValueRequest.ProtoReflect.Descriptor instead. func (*RemoveListValueRequest) Descriptor() ([]byte, []int) { - return file_alpha_proto_rawDescGZIP(), []int{12} + return file_alpha_proto_rawDescGZIP(), []int{13} } func (x *RemoveListValueRequest) GetName() string { @@ -761,6 +828,8 @@ var file_alpha_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, @@ -782,164 +851,183 @@ var file_alpha_proto_rawDesc = []byte{ 0x61, 0x63, 0x69, 0x74, 0x79, 0x3a, 0x2b, 0xea, 0x41, 0x28, 0x0a, 0x12, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x12, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, - 0x72, 0x7d, 0x22, 0x43, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1a, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x14, 0x0a, 0x12, 0x61, - 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, - 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xad, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x53, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, - 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, - 0x42, 0x1a, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x14, 0x0a, 0x12, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, - 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x07, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x72, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, - 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x3a, 0x22, 0xea, 0x41, 0x1f, 0x0a, 0x0f, 0x61, 0x67, - 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0c, 0x6c, - 0x69, 0x73, 0x74, 0x73, 0x2f, 0x7b, 0x6c, 0x69, 0x73, 0x74, 0x7d, 0x22, 0x3d, 0x0a, 0x0e, 0x47, - 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x17, 0xe0, 0x41, 0x02, - 0xfa, 0x41, 0x11, 0x0a, 0x0f, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2f, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x11, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x47, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x17, 0xe0, 0x41, 0x02, 0xfa, - 0x41, 0x11, 0x0a, 0x0f, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x72, 0x7d, 0x22, 0x88, 0x02, 0x0a, 0x14, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x31, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, - 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x5d, 0x0a, 0x13, 0x41, - 0x64, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x69, 0x66, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x44, 0x69, 0x66, 0x66, 0x3a, 0x52, 0xea, 0x41, 0x4f, 0x0a, 0x1f, + 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x2c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2f, 0x7b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x7d, 0x22, 0x43, 0x0a, + 0x11, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x1a, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x14, 0x0a, 0x12, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, + 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0xa0, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x87, 0x01, 0x0a, 0x14, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x67, 0x6f, + 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x27, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x21, 0x0a, 0x1f, + 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, + 0x14, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x72, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, + 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x3a, 0x22, 0xea, 0x41, 0x1f, 0x0a, 0x0f, 0x61, 0x67, 0x6f, 0x6e, + 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0c, 0x6c, 0x69, 0x73, + 0x74, 0x73, 0x2f, 0x7b, 0x6c, 0x69, 0x73, 0x74, 0x7d, 0x22, 0x3d, 0x0a, 0x0e, 0x47, 0x65, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x17, 0xe0, 0x41, 0x02, 0xfa, 0x41, + 0x11, 0x0a, 0x0f, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x47, + 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, + 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x17, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x11, + 0x0a, 0x0f, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x5d, 0x0a, 0x13, 0x41, 0x64, 0x64, + 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x2b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x17, + 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x11, 0x0a, 0x0f, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, + 0x65, 0x76, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x60, 0x0a, 0x16, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x17, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x11, 0x0a, 0x0f, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, - 0xe0, 0x41, 0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x60, 0x0a, 0x16, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x17, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x11, 0x0a, 0x0f, 0x61, 0x67, 0x6f, 0x6e, - 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x19, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x32, 0xf4, 0x0c, 0x0a, - 0x03, 0x53, 0x44, 0x4b, 0x12, 0x6d, 0x0a, 0x0d, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x6f, + 0xe0, 0x41, 0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x32, 0x9c, 0x0d, 0x0a, 0x03, 0x53, + 0x44, 0x4b, 0x12, 0x6d, 0x0a, 0x0d, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x12, 0x1e, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, + 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x49, 0x44, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, + 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x22, + 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x22, 0x15, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, + 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x3a, 0x01, + 0x2a, 0x12, 0x73, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x1e, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x44, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6f, 0x6f, - 0x6c, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x22, 0x15, 0x2f, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x3a, 0x01, 0x2a, 0x12, 0x73, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x69, 0x73, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x1e, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, - 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, - 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x44, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, - 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, - 0x6f, 0x6f, 0x6c, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x18, 0x2f, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x70, 0x0a, 0x11, 0x53, 0x65, 0x74, 0x50, + 0x6c, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x18, 0x2f, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x70, 0x0a, 0x11, 0x53, 0x65, 0x74, 0x50, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x2e, 0x61, 0x67, + 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, + 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x1a, 0x16, 0x2f, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x63, 0x61, 0x70, + 0x61, 0x63, 0x69, 0x74, 0x79, 0x3a, 0x01, 0x2a, 0x12, 0x6d, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x67, 0x6f, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x1a, + 0x61, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x63, - 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x3a, 0x01, 0x2a, 0x12, 0x6d, 0x0a, 0x11, 0x47, 0x65, - 0x74, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, - 0x1b, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x61, - 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x18, 0x12, 0x16, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, - 0x2f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, 0x67, 0x0a, 0x0e, 0x47, 0x65, 0x74, - 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x61, 0x67, - 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, - 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x7b, 0x0a, 0x11, 0x49, 0x73, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x1e, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, - 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, - 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x44, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, - 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, - 0x6f, 0x6f, 0x6c, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x65, 0x64, 0x2f, 0x7b, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x44, 0x7d, 0x12, - 0x77, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, - 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, - 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 0x22, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, - 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, - 0x17, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x80, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x27, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, - 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, - 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, - 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x22, - 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, - 0x73, 0x2f, 0x2a, 0x7d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0xa6, 0x01, 0x0a, 0x0d, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x2a, 0x2e, - 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x67, 0x6f, 0x6e, - 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, - 0x32, 0x23, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x7b, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, - 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0xda, 0x41, - 0x13, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x74, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, - 0x24, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, - 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6c, 0x69, 0x73, 0x74, 0x73, - 0x2f, 0x2a, 0x7d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x91, 0x01, 0x0a, 0x0a, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x27, 0x2e, 0x61, 0x67, 0x6f, 0x6e, + 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, 0x67, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, - 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x3e, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x32, 0x1d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2f, 0x7b, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6c, 0x69, 0x73, - 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0xda, 0x41, 0x10, 0x6c, 0x69, - 0x73, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x83, - 0x01, 0x0a, 0x0c, 0x41, 0x64, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x29, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x64, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x6f, - 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x22, 0x21, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, - 0x6c, 0x69, 0x73, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x61, 0x64, 0x64, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x8c, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4c, - 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x7b, 0x0a, 0x11, 0x49, 0x73, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x1e, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x49, 0x44, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6f, 0x6f, + 0x6c, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x2f, 0x7b, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x44, 0x7d, 0x12, 0x77, 0x0a, + 0x13, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, + 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x1a, 0x22, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, + 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, + 0x44, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x80, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x27, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, + 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x22, 0x2a, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x2f, + 0x2a, 0x7d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0xce, 0x01, 0x0a, 0x0d, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x61, 0x67, + 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x22, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x55, 0x32, 0x3d, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x7b, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x14, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0xda, 0x41, 0x14, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x74, 0x0a, 0x07, 0x47, 0x65, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x24, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x67, + 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, + 0x18, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, + 0x3d, 0x6c, 0x69, 0x73, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x91, 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x27, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, + 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, - 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6c, 0x69, 0x73, 0x74, - 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x01, 0x2a, 0x42, 0x53, 0x5a, 0x07, 0x2e, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x92, 0x41, - 0x47, 0x12, 0x1e, 0x0a, 0x0b, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x32, 0x0f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x65, - 0x74, 0x2a, 0x01, 0x01, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x4c, 0x69, 0x73, 0x74, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x32, 0x1d, 0x2f, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x7b, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x6c, 0x69, 0x73, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x04, 0x6c, 0x69, 0x73, + 0x74, 0xda, 0x41, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x83, 0x01, 0x0a, 0x0c, 0x41, 0x64, 0x64, 0x4c, 0x69, 0x73, 0x74, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x29, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x64, 0x64, + 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, + 0x6b, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x2c, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x26, 0x22, 0x21, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6c, 0x69, 0x73, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x61, + 0x64, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x8c, 0x01, 0x0a, 0x0f, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2c, + 0x2e, 0x61, 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4c, 0x69, 0x73, 0x74, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, + 0x67, 0x6f, 0x6e, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, + 0x22, 0x24, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, + 0x65, 0x3d, 0x6c, 0x69, 0x73, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x72, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x01, 0x2a, 0x42, 0x53, 0x5a, 0x07, 0x2e, 0x2f, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x92, 0x41, 0x47, 0x12, 0x1e, 0x0a, 0x0b, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x0f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, + 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x65, 0x74, 0x2a, 0x01, 0x01, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -954,7 +1042,7 @@ func file_alpha_proto_rawDescGZIP() []byte { return file_alpha_proto_rawDescData } -var file_alpha_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_alpha_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_alpha_proto_goTypes = []interface{}{ (*Empty)(nil), // 0: agones.dev.sdk.alpha.Empty (*Count)(nil), // 1: agones.dev.sdk.alpha.Count @@ -962,51 +1050,54 @@ var file_alpha_proto_goTypes = []interface{}{ (*PlayerID)(nil), // 3: agones.dev.sdk.alpha.PlayerID (*PlayerIDList)(nil), // 4: agones.dev.sdk.alpha.PlayerIDList (*Counter)(nil), // 5: agones.dev.sdk.alpha.Counter - (*GetCounterRequest)(nil), // 6: agones.dev.sdk.alpha.GetCounterRequest - (*UpdateCounterRequest)(nil), // 7: agones.dev.sdk.alpha.UpdateCounterRequest - (*List)(nil), // 8: agones.dev.sdk.alpha.List - (*GetListRequest)(nil), // 9: agones.dev.sdk.alpha.GetListRequest - (*UpdateListRequest)(nil), // 10: agones.dev.sdk.alpha.UpdateListRequest - (*AddListValueRequest)(nil), // 11: agones.dev.sdk.alpha.AddListValueRequest - (*RemoveListValueRequest)(nil), // 12: agones.dev.sdk.alpha.RemoveListValueRequest - (*fieldmaskpb.FieldMask)(nil), // 13: google.protobuf.FieldMask + (*CounterUpdateRequest)(nil), // 6: agones.dev.sdk.alpha.CounterUpdateRequest + (*GetCounterRequest)(nil), // 7: agones.dev.sdk.alpha.GetCounterRequest + (*UpdateCounterRequest)(nil), // 8: agones.dev.sdk.alpha.UpdateCounterRequest + (*List)(nil), // 9: agones.dev.sdk.alpha.List + (*GetListRequest)(nil), // 10: agones.dev.sdk.alpha.GetListRequest + (*UpdateListRequest)(nil), // 11: agones.dev.sdk.alpha.UpdateListRequest + (*AddListValueRequest)(nil), // 12: agones.dev.sdk.alpha.AddListValueRequest + (*RemoveListValueRequest)(nil), // 13: agones.dev.sdk.alpha.RemoveListValueRequest + (*wrapperspb.Int64Value)(nil), // 14: google.protobuf.Int64Value + (*fieldmaskpb.FieldMask)(nil), // 15: google.protobuf.FieldMask } var file_alpha_proto_depIdxs = []int32{ - 5, // 0: agones.dev.sdk.alpha.UpdateCounterRequest.counter:type_name -> agones.dev.sdk.alpha.Counter - 13, // 1: agones.dev.sdk.alpha.UpdateCounterRequest.update_mask:type_name -> google.protobuf.FieldMask - 8, // 2: agones.dev.sdk.alpha.UpdateListRequest.list:type_name -> agones.dev.sdk.alpha.List - 13, // 3: agones.dev.sdk.alpha.UpdateListRequest.update_mask:type_name -> google.protobuf.FieldMask - 3, // 4: agones.dev.sdk.alpha.SDK.PlayerConnect:input_type -> agones.dev.sdk.alpha.PlayerID - 3, // 5: agones.dev.sdk.alpha.SDK.PlayerDisconnect:input_type -> agones.dev.sdk.alpha.PlayerID - 1, // 6: agones.dev.sdk.alpha.SDK.SetPlayerCapacity:input_type -> agones.dev.sdk.alpha.Count - 0, // 7: agones.dev.sdk.alpha.SDK.GetPlayerCapacity:input_type -> agones.dev.sdk.alpha.Empty - 0, // 8: agones.dev.sdk.alpha.SDK.GetPlayerCount:input_type -> agones.dev.sdk.alpha.Empty - 3, // 9: agones.dev.sdk.alpha.SDK.IsPlayerConnected:input_type -> agones.dev.sdk.alpha.PlayerID - 0, // 10: agones.dev.sdk.alpha.SDK.GetConnectedPlayers:input_type -> agones.dev.sdk.alpha.Empty - 6, // 11: agones.dev.sdk.alpha.SDK.GetCounter:input_type -> agones.dev.sdk.alpha.GetCounterRequest - 7, // 12: agones.dev.sdk.alpha.SDK.UpdateCounter:input_type -> agones.dev.sdk.alpha.UpdateCounterRequest - 9, // 13: agones.dev.sdk.alpha.SDK.GetList:input_type -> agones.dev.sdk.alpha.GetListRequest - 10, // 14: agones.dev.sdk.alpha.SDK.UpdateList:input_type -> agones.dev.sdk.alpha.UpdateListRequest - 11, // 15: agones.dev.sdk.alpha.SDK.AddListValue:input_type -> agones.dev.sdk.alpha.AddListValueRequest - 12, // 16: agones.dev.sdk.alpha.SDK.RemoveListValue:input_type -> agones.dev.sdk.alpha.RemoveListValueRequest - 2, // 17: agones.dev.sdk.alpha.SDK.PlayerConnect:output_type -> agones.dev.sdk.alpha.Bool - 2, // 18: agones.dev.sdk.alpha.SDK.PlayerDisconnect:output_type -> agones.dev.sdk.alpha.Bool - 0, // 19: agones.dev.sdk.alpha.SDK.SetPlayerCapacity:output_type -> agones.dev.sdk.alpha.Empty - 1, // 20: agones.dev.sdk.alpha.SDK.GetPlayerCapacity:output_type -> agones.dev.sdk.alpha.Count - 1, // 21: agones.dev.sdk.alpha.SDK.GetPlayerCount:output_type -> agones.dev.sdk.alpha.Count - 2, // 22: agones.dev.sdk.alpha.SDK.IsPlayerConnected:output_type -> agones.dev.sdk.alpha.Bool - 4, // 23: agones.dev.sdk.alpha.SDK.GetConnectedPlayers:output_type -> agones.dev.sdk.alpha.PlayerIDList - 5, // 24: agones.dev.sdk.alpha.SDK.GetCounter:output_type -> agones.dev.sdk.alpha.Counter - 5, // 25: agones.dev.sdk.alpha.SDK.UpdateCounter:output_type -> agones.dev.sdk.alpha.Counter - 8, // 26: agones.dev.sdk.alpha.SDK.GetList:output_type -> agones.dev.sdk.alpha.List - 8, // 27: agones.dev.sdk.alpha.SDK.UpdateList:output_type -> agones.dev.sdk.alpha.List - 8, // 28: agones.dev.sdk.alpha.SDK.AddListValue:output_type -> agones.dev.sdk.alpha.List - 8, // 29: agones.dev.sdk.alpha.SDK.RemoveListValue:output_type -> agones.dev.sdk.alpha.List - 17, // [17:30] is the sub-list for method output_type - 4, // [4:17] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 14, // 0: agones.dev.sdk.alpha.CounterUpdateRequest.count:type_name -> google.protobuf.Int64Value + 14, // 1: agones.dev.sdk.alpha.CounterUpdateRequest.capacity:type_name -> google.protobuf.Int64Value + 6, // 2: agones.dev.sdk.alpha.UpdateCounterRequest.counterUpdateRequest:type_name -> agones.dev.sdk.alpha.CounterUpdateRequest + 9, // 3: agones.dev.sdk.alpha.UpdateListRequest.list:type_name -> agones.dev.sdk.alpha.List + 15, // 4: agones.dev.sdk.alpha.UpdateListRequest.update_mask:type_name -> google.protobuf.FieldMask + 3, // 5: agones.dev.sdk.alpha.SDK.PlayerConnect:input_type -> agones.dev.sdk.alpha.PlayerID + 3, // 6: agones.dev.sdk.alpha.SDK.PlayerDisconnect:input_type -> agones.dev.sdk.alpha.PlayerID + 1, // 7: agones.dev.sdk.alpha.SDK.SetPlayerCapacity:input_type -> agones.dev.sdk.alpha.Count + 0, // 8: agones.dev.sdk.alpha.SDK.GetPlayerCapacity:input_type -> agones.dev.sdk.alpha.Empty + 0, // 9: agones.dev.sdk.alpha.SDK.GetPlayerCount:input_type -> agones.dev.sdk.alpha.Empty + 3, // 10: agones.dev.sdk.alpha.SDK.IsPlayerConnected:input_type -> agones.dev.sdk.alpha.PlayerID + 0, // 11: agones.dev.sdk.alpha.SDK.GetConnectedPlayers:input_type -> agones.dev.sdk.alpha.Empty + 7, // 12: agones.dev.sdk.alpha.SDK.GetCounter:input_type -> agones.dev.sdk.alpha.GetCounterRequest + 8, // 13: agones.dev.sdk.alpha.SDK.UpdateCounter:input_type -> agones.dev.sdk.alpha.UpdateCounterRequest + 10, // 14: agones.dev.sdk.alpha.SDK.GetList:input_type -> agones.dev.sdk.alpha.GetListRequest + 11, // 15: agones.dev.sdk.alpha.SDK.UpdateList:input_type -> agones.dev.sdk.alpha.UpdateListRequest + 12, // 16: agones.dev.sdk.alpha.SDK.AddListValue:input_type -> agones.dev.sdk.alpha.AddListValueRequest + 13, // 17: agones.dev.sdk.alpha.SDK.RemoveListValue:input_type -> agones.dev.sdk.alpha.RemoveListValueRequest + 2, // 18: agones.dev.sdk.alpha.SDK.PlayerConnect:output_type -> agones.dev.sdk.alpha.Bool + 2, // 19: agones.dev.sdk.alpha.SDK.PlayerDisconnect:output_type -> agones.dev.sdk.alpha.Bool + 0, // 20: agones.dev.sdk.alpha.SDK.SetPlayerCapacity:output_type -> agones.dev.sdk.alpha.Empty + 1, // 21: agones.dev.sdk.alpha.SDK.GetPlayerCapacity:output_type -> agones.dev.sdk.alpha.Count + 1, // 22: agones.dev.sdk.alpha.SDK.GetPlayerCount:output_type -> agones.dev.sdk.alpha.Count + 2, // 23: agones.dev.sdk.alpha.SDK.IsPlayerConnected:output_type -> agones.dev.sdk.alpha.Bool + 4, // 24: agones.dev.sdk.alpha.SDK.GetConnectedPlayers:output_type -> agones.dev.sdk.alpha.PlayerIDList + 5, // 25: agones.dev.sdk.alpha.SDK.GetCounter:output_type -> agones.dev.sdk.alpha.Counter + 5, // 26: agones.dev.sdk.alpha.SDK.UpdateCounter:output_type -> agones.dev.sdk.alpha.Counter + 9, // 27: agones.dev.sdk.alpha.SDK.GetList:output_type -> agones.dev.sdk.alpha.List + 9, // 28: agones.dev.sdk.alpha.SDK.UpdateList:output_type -> agones.dev.sdk.alpha.List + 9, // 29: agones.dev.sdk.alpha.SDK.AddListValue:output_type -> agones.dev.sdk.alpha.List + 9, // 30: agones.dev.sdk.alpha.SDK.RemoveListValue:output_type -> agones.dev.sdk.alpha.List + 18, // [18:31] is the sub-list for method output_type + 5, // [5:18] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_alpha_proto_init() } @@ -1088,7 +1179,7 @@ func file_alpha_proto_init() { } } file_alpha_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCounterRequest); i { + switch v := v.(*CounterUpdateRequest); i { case 0: return &v.state case 1: @@ -1100,7 +1191,7 @@ func file_alpha_proto_init() { } } file_alpha_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateCounterRequest); i { + switch v := v.(*GetCounterRequest); i { case 0: return &v.state case 1: @@ -1112,7 +1203,7 @@ func file_alpha_proto_init() { } } file_alpha_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*List); i { + switch v := v.(*UpdateCounterRequest); i { case 0: return &v.state case 1: @@ -1124,7 +1215,7 @@ func file_alpha_proto_init() { } } file_alpha_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetListRequest); i { + switch v := v.(*List); i { case 0: return &v.state case 1: @@ -1136,7 +1227,7 @@ func file_alpha_proto_init() { } } file_alpha_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateListRequest); i { + switch v := v.(*GetListRequest); i { case 0: return &v.state case 1: @@ -1148,7 +1239,7 @@ func file_alpha_proto_init() { } } file_alpha_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddListValueRequest); i { + switch v := v.(*UpdateListRequest); i { case 0: return &v.state case 1: @@ -1160,6 +1251,18 @@ func file_alpha_proto_init() { } } file_alpha_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddListValueRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_alpha_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoveListValueRequest); i { case 0: return &v.state @@ -1178,7 +1281,7 @@ func file_alpha_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_alpha_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 14, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/sdk/alpha/alpha.pb.gw.go b/pkg/sdk/alpha/alpha.pb.gw.go index f0c227f853..e1c26654c0 100644 --- a/pkg/sdk/alpha/alpha.pb.gw.go +++ b/pkg/sdk/alpha/alpha.pb.gw.go @@ -306,10 +306,6 @@ func local_request_SDK_GetCounter_0(ctx context.Context, marshaler runtime.Marsh } -var ( - filter_SDK_UpdateCounter_0 = &utilities.DoubleArray{Encoding: map[string]int{"counter": 0, "name": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} -) - func request_SDK_UpdateCounter_0(ctx context.Context, marshaler runtime.Marshaler, client SDKClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq UpdateCounterRequest var metadata runtime.ServerMetadata @@ -318,16 +314,9 @@ func request_SDK_UpdateCounter_0(ctx context.Context, marshaler runtime.Marshale if berr != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Counter); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.CounterUpdateRequest); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { - if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Counter); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } else { - protoReq.UpdateMask = fieldMask - } - } var ( val string @@ -336,21 +325,14 @@ func request_SDK_UpdateCounter_0(ctx context.Context, marshaler runtime.Marshale _ = err ) - val, ok = pathParams["counter.name"] + val, ok = pathParams["counterUpdateRequest.name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "counter.name") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "counterUpdateRequest.name") } - err = runtime.PopulateFieldFromPath(&protoReq, "counter.name", val) + err = runtime.PopulateFieldFromPath(&protoReq, "counterUpdateRequest.name", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "counter.name", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SDK_UpdateCounter_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "counterUpdateRequest.name", err) } msg, err := client.UpdateCounter(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -366,16 +348,9 @@ func local_request_SDK_UpdateCounter_0(ctx context.Context, marshaler runtime.Ma if berr != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Counter); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.CounterUpdateRequest); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { - if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Counter); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } else { - protoReq.UpdateMask = fieldMask - } - } var ( val string @@ -384,21 +359,14 @@ func local_request_SDK_UpdateCounter_0(ctx context.Context, marshaler runtime.Ma _ = err ) - val, ok = pathParams["counter.name"] + val, ok = pathParams["counterUpdateRequest.name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "counter.name") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "counterUpdateRequest.name") } - err = runtime.PopulateFieldFromPath(&protoReq, "counter.name", val) + err = runtime.PopulateFieldFromPath(&protoReq, "counterUpdateRequest.name", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "counter.name", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SDK_UpdateCounter_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "counterUpdateRequest.name", err) } msg, err := server.UpdateCounter(ctx, &protoReq) @@ -908,7 +876,7 @@ func RegisterSDKHandlerServer(ctx context.Context, mux *runtime.ServeMux, server inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/agones.dev.sdk.alpha.SDK/UpdateCounter", runtime.WithHTTPPathPattern("/v1alpha1/{counter.name=counters/*}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/agones.dev.sdk.alpha.SDK/UpdateCounter", runtime.WithHTTPPathPattern("/v1alpha1/{counterUpdateRequest.name=counterUpdateRequests/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1248,7 +1216,7 @@ func RegisterSDKHandlerClient(ctx context.Context, mux *runtime.ServeMux, client inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/agones.dev.sdk.alpha.SDK/UpdateCounter", runtime.WithHTTPPathPattern("/v1alpha1/{counter.name=counters/*}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/agones.dev.sdk.alpha.SDK/UpdateCounter", runtime.WithHTTPPathPattern("/v1alpha1/{counterUpdateRequest.name=counterUpdateRequests/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1372,7 +1340,7 @@ var ( pattern_SDK_GetCounter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1alpha1", "counters", "name"}, "")) - pattern_SDK_UpdateCounter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1alpha1", "counters", "counter.name"}, "")) + pattern_SDK_UpdateCounter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1alpha1", "counterUpdateRequests", "counterUpdateRequest.name"}, "")) pattern_SDK_GetList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1alpha1", "lists", "name"}, "")) diff --git a/pkg/sdk/alpha/alpha_grpc.pb.go b/pkg/sdk/alpha/alpha_grpc.pb.go index 5aab5b156c..f3dd4c33f2 100644 --- a/pkg/sdk/alpha/alpha_grpc.pb.go +++ b/pkg/sdk/alpha/alpha_grpc.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.6 +// - protoc v3.21.12 // source: alpha.proto package alpha @@ -95,9 +95,6 @@ type SDKClient interface { GetCounter(ctx context.Context, in *GetCounterRequest, opts ...grpc.CallOption) (*Counter, error) // UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated). // Returns OUT_OF_RANGE if the Count is out of range [0,Capacity]. - // Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the Counter. - // If a field mask path(s) is specified, but the value is not set in the request Counter object, - // then the default value for the variable will be set (i.e. 0 for "capacity" or "count"). UpdateCounter(ctx context.Context, in *UpdateCounterRequest, opts ...grpc.CallOption) (*Counter, error) // Gets a List. Returns NOT_FOUND if the List does not exist. GetList(ctx context.Context, in *GetListRequest, opts ...grpc.CallOption) (*List, error) @@ -303,9 +300,6 @@ type SDKServer interface { GetCounter(context.Context, *GetCounterRequest) (*Counter, error) // UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated). // Returns OUT_OF_RANGE if the Count is out of range [0,Capacity]. - // Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the Counter. - // If a field mask path(s) is specified, but the value is not set in the request Counter object, - // then the default value for the variable will be set (i.e. 0 for "capacity" or "count"). UpdateCounter(context.Context, *UpdateCounterRequest) (*Counter, error) // Gets a List. Returns NOT_FOUND if the List does not exist. GetList(context.Context, *GetListRequest) (*List, error) diff --git a/pkg/sdk/beta/beta.pb.go b/pkg/sdk/beta/beta.pb.go index 02a686c3a8..3a1091b211 100644 --- a/pkg/sdk/beta/beta.pb.go +++ b/pkg/sdk/beta/beta.pb.go @@ -30,7 +30,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.6 +// protoc v3.21.12 // source: beta.proto package beta diff --git a/pkg/sdk/beta/beta_grpc.pb.go b/pkg/sdk/beta/beta_grpc.pb.go index 721f2cc983..1d89948bb3 100644 --- a/pkg/sdk/beta/beta_grpc.pb.go +++ b/pkg/sdk/beta/beta_grpc.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.6 +// - protoc v3.21.12 // source: beta.proto package beta diff --git a/pkg/sdk/sdk.pb.go b/pkg/sdk/sdk.pb.go index e295f68508..f6095ceb26 100644 --- a/pkg/sdk/sdk.pb.go +++ b/pkg/sdk/sdk.pb.go @@ -30,7 +30,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.6 +// protoc v3.21.12 // source: sdk.proto package sdk diff --git a/pkg/sdk/sdk_grpc.pb.go b/pkg/sdk/sdk_grpc.pb.go index e2aa70e64c..8448212775 100644 --- a/pkg/sdk/sdk_grpc.pb.go +++ b/pkg/sdk/sdk_grpc.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.6 +// - protoc v3.21.12 // source: sdk.proto package sdk diff --git a/pkg/sdkserver/localsdk.go b/pkg/sdkserver/localsdk.go index 58665ba022..b28165c709 100644 --- a/pkg/sdkserver/localsdk.go +++ b/pkg/sdkserver/localsdk.go @@ -606,58 +606,12 @@ func (l *LocalSDKServer) GetCounter(ctx context.Context, in *alpha.GetCounterReq return nil, errors.Errorf("NOT_FOUND. %s Counter not found", in.Name) } -// UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated). -// Returns OUT_OF_RANGE if the Count is out of range [0,Capacity]. -// Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the Counter. -// If a field mask path(s) is specified, but the value is not set in the request Counter object, -// then the default value for the variable will be set (i.e. 0 for "capacity" or "count"). +// UpdateCounter returns the updated Counter. // [Stage:Alpha] // [FeatureFlag:CountsAndLists] func (l *LocalSDKServer) UpdateCounter(ctx context.Context, in *alpha.UpdateCounterRequest) (*alpha.Counter, error) { - if !runtime.FeatureEnabled(runtime.FeatureCountsAndLists) { - return nil, errors.Errorf("%s not enabled", runtime.FeatureCountsAndLists) - } - - if in.Counter == nil || in.UpdateMask == nil { - return nil, errors.Errorf("INVALID_ARGUMENT. Counter: %v and UpdateMask %v cannot be nil", in.Counter, in.UpdateMask) - } - - l.logger.WithField("name", in.Counter.Name).Info("Updating Counter") - l.recordRequest("updatecounter") - l.gsMutex.Lock() - defer l.gsMutex.Unlock() - - // TODO: https://google.aip.dev/134, "Update masks must support a special value *, meaning full replacement." - // Check if the UpdateMask paths are valid, return INVALID_ARGUMENT if not. - if !in.UpdateMask.IsValid(in.Counter.ProtoReflect().Interface()) { - return nil, errors.Errorf("INVALID_ARGUMENT. Field Mask Path(s): %v are invalid for Counter. Use valid field name(s): %v", in.UpdateMask.GetPaths(), in.Counter.ProtoReflect().Descriptor().Fields()) - } - - // TODO: Pull in variable Max Capacity from CRD instead of hard-coded number here. - if in.Counter.Capacity < 0 || in.Counter.Capacity > 1000 { - return nil, errors.Errorf("OUT_OF_RANGE. Capacity must be within range [0,1000]. Found Capacity: %d", in.Counter.Capacity) - } - - name := in.Counter.Name - if counter, ok := l.gs.Status.Counters[name]; ok { - // Create *alpha.Counter from *sdk.GameServer_Status_CounterStatus for merging. - tmpCounter := &alpha.Counter{Name: name, Count: counter.Count, Capacity: counter.Capacity} - // Removes any fields from the request object that are not included in the FieldMask Paths. - fmutils.Filter(in.Counter, in.UpdateMask.Paths) - // Removes any fields from the existing gameserver object that are included in the FieldMask Paths. - fmutils.Prune(tmpCounter, in.UpdateMask.Paths) - // Due due filtering and pruning all gameserver object field(s) contained in the FieldMask are overwritten by the request object field(s). - proto.Merge(tmpCounter, in.Counter) - // Verify that 0 <= Count >= Capacity - if tmpCounter.Count < 0 || tmpCounter.Count > tmpCounter.Capacity { - return nil, errors.Errorf("OUT_OF_RANGE. Count must be within range [0,Capacity]. Found Count: %d, Capacity: %d", tmpCounter.Count, tmpCounter.Capacity) - } - // Write newly updated Counter to gameserverstatus. - l.gs.Status.Counters[name].Count = tmpCounter.Count - l.gs.Status.Counters[name].Capacity = tmpCounter.Capacity - return &alpha.Counter{Name: name, Count: l.gs.Status.Counters[name].Count, Capacity: l.gs.Status.Counters[name].Capacity}, nil - } - return nil, errors.Errorf("NOT_FOUND. %s Counter not found", name) + // TODO(#2716): Implement me + return nil, errors.Errorf("Unimplemented -- UpdateCounter coming soon") } // GetList returns a List. Returns NOT_FOUND if the List does not exist. diff --git a/pkg/sdkserver/localsdk_test.go b/pkg/sdkserver/localsdk_test.go index 46aba7bfe6..ea45c13aef 100644 --- a/pkg/sdkserver/localsdk_test.go +++ b/pkg/sdkserver/localsdk_test.go @@ -683,196 +683,6 @@ func TestLocalSDKServerGetCounter(t *testing.T) { } } -func TestLocalSDKServerUpdateCounter(t *testing.T) { - t.Parallel() - - runtime.FeatureTestMutex.Lock() - defer runtime.FeatureTestMutex.Unlock() - assert.NoError(t, runtime.ParseFeatures(string(runtime.FeatureCountsAndLists)+"=true")) - - counters := map[string]agonesv1.CounterStatus{ - "sessions": {Count: 1, Capacity: 100}, - "players": {Count: 100, Capacity: 100}, - "lobbies": {Count: 0, Capacity: 0}, - } - fixture := &agonesv1.GameServer{ - ObjectMeta: metav1.ObjectMeta{Name: "stuff"}, - Status: agonesv1.GameServerStatus{ - Counters: counters, - }, - } - - path, err := gsToTmpFile(fixture) - assert.NoError(t, err) - l, err := NewLocalSDKServer(path, "") - assert.Nil(t, err) - - stream := newGameServerMockStream() - go func() { - err := l.WatchGameServer(&sdk.Empty{}, stream) - assert.Nil(t, err) - }() - assertInitialWatchUpdate(t, stream) - - // wait for watching to begin - err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { - found := false - l.updateObservers.Range(func(_, _ interface{}) bool { - found = true - return false - }) - return found, nil - }) - assert.NoError(t, err) - - testScenarios := map[string]struct { - updateRequest *alpha.UpdateCounterRequest - want *alpha.Counter - wantErr error - }{ - "only updates fields in the FieldMask": { - updateRequest: &alpha.UpdateCounterRequest{ - Counter: &alpha.Counter{ - Name: "sessions", - Count: int64(10), - Capacity: int64(999), - }, - UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"count"}}, - }, - want: &alpha.Counter{ - Name: "sessions", - Count: int64(10), - Capacity: int64(100), - }, - }, - "updates both fields in the FieldMask": { - updateRequest: &alpha.UpdateCounterRequest{ - Counter: &alpha.Counter{ - Name: "lobbies", - Count: int64(9), - Capacity: int64(999), - }, - UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"capacity", "count"}}, - }, - want: &alpha.Counter{ - Name: "lobbies", - Count: int64(9), - Capacity: int64(999), - }, - }, - "default value for Count is applied": { - updateRequest: &alpha.UpdateCounterRequest{ - Counter: &alpha.Counter{ - Name: "players", - }, - UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"count"}}, - }, - want: &alpha.Counter{ - Name: "players", - Count: int64(0), - Capacity: int64(100), - }, - }, - "Counter does not exist": { - updateRequest: &alpha.UpdateCounterRequest{ - Counter: &alpha.Counter{ - Name: "dragons", - }, - UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"count"}}, - }, - wantErr: errors.Errorf("NOT_FOUND. %s Counter not found", "dragons"), - }, - "request Counter is nil": { - updateRequest: &alpha.UpdateCounterRequest{ - Counter: nil, - UpdateMask: &fieldmaskpb.FieldMask{}, - }, - wantErr: errors.Errorf("INVALID_ARGUMENT. Counter: %v and UpdateMask %v cannot be nil", nil, &fieldmaskpb.FieldMask{}), - }, - "request UpdateMask is nil": { - updateRequest: &alpha.UpdateCounterRequest{ - Counter: &alpha.Counter{}, - UpdateMask: nil, - }, - wantErr: errors.Errorf("INVALID_ARGUMENT. Counter: %v and UpdateMask %v cannot be nil", &alpha.Counter{}, nil), - }, - "updateMask contains invalid path": { - updateRequest: &alpha.UpdateCounterRequest{ - Counter: &alpha.Counter{ - Name: "lobbies", - }, - UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"foo"}}, - }, - wantErr: errors.Errorf("INVALID_ARGUMENT. Field Mask Path(s): [foo] are invalid for Counter. Use valid field name(s): "), - }, - "updateMask is empty": { - updateRequest: &alpha.UpdateCounterRequest{ - Counter: &alpha.Counter{ - Name: "lobbies", - }, - UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{""}}, - }, - wantErr: errors.Errorf("INVALID_ARGUMENT. Field Mask Path(s): [] are invalid for Counter. Use valid field name(s): "), - }, - "capacity is less than zero": { - updateRequest: &alpha.UpdateCounterRequest{ - Counter: &alpha.Counter{ - Name: "lobbies", - Capacity: -1, - }, - UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"capacity"}}, - }, - wantErr: errors.Errorf("OUT_OF_RANGE. Capacity must be within range [0,1000]. Found Capacity: %d", int64(-1)), - }, - "capacity greater than max capacity (1000)": { - updateRequest: &alpha.UpdateCounterRequest{ - Counter: &alpha.Counter{ - Name: "lobbies", - Capacity: 1001, - }, - UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"capacity"}}, - }, - wantErr: errors.Errorf("OUT_OF_RANGE. Capacity must be within range [0,1000]. Found Capacity: %d", int64(1001)), - }, - "count is less than zero": { - updateRequest: &alpha.UpdateCounterRequest{ - Counter: &alpha.Counter{ - Name: "players", - Count: -1, - }, - UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"count"}}, - }, - wantErr: errors.Errorf("OUT_OF_RANGE. Count must be within range [0,Capacity]. Found Count: %d, Capacity: %d", -1, int64(100)), - }, - "count is greater than capacity": { - updateRequest: &alpha.UpdateCounterRequest{ - Counter: &alpha.Counter{ - Name: "players", - Count: 101, - }, - UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"count"}}, - }, - wantErr: errors.Errorf("OUT_OF_RANGE. Count must be within range [0,Capacity]. Found Count: %d, Capacity: %d", 101, int64(100)), - }, - } - - for testName, testScenario := range testScenarios { - t.Run(testName, func(t *testing.T) { - got, err := l.UpdateCounter(context.Background(), testScenario.updateRequest) - // Check tests expecting non-errors - if testScenario.want != nil { - assert.NoError(t, err) - if diff := cmp.Diff(testScenario.want, got, protocmp.Transform()); diff != "" { - t.Errorf("Unexpected difference:\n%v", diff) - } - } else { - // Check tests expecting errors - assert.ErrorContains(t, err, testScenario.wantErr.Error()) - } - }) - } -} - func TestLocalSDKServerGetList(t *testing.T) { t.Parallel() diff --git a/pkg/sdkserver/sdkserver.go b/pkg/sdkserver/sdkserver.go index bd8872ceb1..9db20819bb 100644 --- a/pkg/sdkserver/sdkserver.go +++ b/pkg/sdkserver/sdkserver.go @@ -55,12 +55,13 @@ import ( type Operation string const ( - updateState Operation = "updateState" - updateLabel Operation = "updateLabel" - updateAnnotation Operation = "updateAnnotation" - updatePlayerCapacity Operation = "updatePlayerCapacity" - updateConnectedPlayers Operation = "updateConnectedPlayers" - playerCountUpdatePeriod time.Duration = time.Second + updateState Operation = "updateState" + updateLabel Operation = "updateLabel" + updateAnnotation Operation = "updateAnnotation" + updatePlayerCapacity Operation = "updatePlayerCapacity" + updateConnectedPlayers Operation = "updateConnectedPlayers" + updateCounters Operation = "updateCounters" + updatePeriod time.Duration = time.Second ) var ( @@ -69,6 +70,17 @@ var ( _ beta.SDKServer = &SDKServer{} ) +type counterUpdateRequest struct { + // Capacity of the Counter as set by capacitySet. + capacitySet *int64 + // Count of the Counter as set by countSet. + countSet *int64 + // Tracks the sum of CountIncrement, CountDecrement, and/or CountSet requests from the client SDK. + diff int64 + // Counter as retreived from the GameServer + counter agonesv1.CounterStatus +} + // SDKServer is a gRPC server, that is meant to be a sidecar // for a GameServer that will update the game server status on SDK requests // @@ -105,6 +117,8 @@ type SDKServer struct { gsReserveDuration *time.Duration gsPlayerCapacity int64 gsConnectedPlayers []string + gsCounterUpdates map[string]counterUpdateRequest + gsCopy *agonesv1.GameServer } // NewSDKServer creates a SDKServer that sets up an @@ -143,6 +157,11 @@ func NewSDKServer(gameServerName, namespace string, kubeClient kubernetes.Interf gsStateChannel: make(chan agonesv1.GameServerState, 2), } + if runtime.FeatureEnabled(runtime.FeatureCountsAndLists) { + // Once FeatureCountsAndLists is in GA, move this into SDKServer creation above. + s.gsCounterUpdates = map[string]counterUpdateRequest{} + } + s.informerFactory = factory s.logger = runtime.NewLoggerWithType(s).WithField("gsKey", namespace+"/"+gameServerName) @@ -311,6 +330,8 @@ func (s *SDKServer) syncGameServer(ctx context.Context, key string) error { return s.updatePlayerCapacity(ctx) case updateConnectedPlayers: return s.updateConnectedPlayers(ctx) + case updateCounters: + return s.updateCounter(ctx) } return errors.Errorf("could not sync game server key: %s", key) @@ -404,12 +425,21 @@ func (s *SDKServer) updateState(ctx context.Context) error { return nil } +// Gets the GameServer from the cache, or from the local SDKServer if that version is more recent. func (s *SDKServer) gameServer() (*agonesv1.GameServer, error) { // this ensure that if we get requests for the gameserver before the cache has been synced, // they will block here until it's ready s.gsWaitForSync.Wait() gs, err := s.gameServerLister.GameServers(s.namespace).Get(s.gameServerName) - return gs, errors.Wrapf(err, "could not retrieve GameServer %s/%s", s.namespace, s.gameServerName) + if err != nil { + return gs, errors.Wrapf(err, "could not retrieve GameServer %s/%s", s.namespace, s.gameServerName) + } + s.gsUpdateMutex.RLock() + defer s.gsUpdateMutex.RUnlock() + if s.gsCopy != nil && gs.ObjectMeta.Generation < s.gsCopy.Generation { + return s.gsCopy, nil + } + return gs, nil } // updateLabels updates the labels on this GameServer to the ones persisted in SDKServer, @@ -644,7 +674,7 @@ func (s *SDKServer) PlayerConnect(ctx context.Context, id *alpha.PlayerID) (*alp // let's retain the original order, as it should be a smaller patch on data change s.gsConnectedPlayers = append(s.gsConnectedPlayers, id.PlayerID) - s.workerqueue.EnqueueAfter(cache.ExplicitKey(string(updateConnectedPlayers)), playerCountUpdatePeriod) + s.workerqueue.EnqueueAfter(cache.ExplicitKey(string(updateConnectedPlayers)), updatePeriod) return &alpha.Bool{Bool: true}, nil } @@ -674,7 +704,7 @@ func (s *SDKServer) PlayerDisconnect(ctx context.Context, id *alpha.PlayerID) (* // let's retain the original order, as it should be a smaller patch on data change s.gsConnectedPlayers = append(s.gsConnectedPlayers[:found], s.gsConnectedPlayers[found+1:]...) - s.workerqueue.EnqueueAfter(cache.ExplicitKey(string(updateConnectedPlayers)), playerCountUpdatePeriod) + s.workerqueue.EnqueueAfter(cache.ExplicitKey(string(updateConnectedPlayers)), updatePeriod) return &alpha.Bool{Bool: true}, nil } @@ -755,27 +785,197 @@ func (s *SDKServer) GetPlayerCapacity(ctx context.Context, _ *alpha.Empty) (*alp return &alpha.Count{Count: s.gsPlayerCapacity}, nil } -// GetCounter returns a Counter. Returns NOT_FOUND if the counter does not exist. +// GetCounter returns a Counter. Returns error if the counter does not exist. // [Stage:Alpha] // [FeatureFlag:CountsAndLists] func (s *SDKServer) GetCounter(ctx context.Context, in *alpha.GetCounterRequest) (*alpha.Counter, error) { if !runtime.FeatureEnabled(runtime.FeatureCountsAndLists) { return nil, errors.Errorf("%s not enabled", runtime.FeatureCountsAndLists) } - // TODO(#2716): Implement me - return nil, errors.Errorf("Unimplemented -- GetCounter coming soon") + + s.logger.WithField("name", in.Name).Debug("Getting Counter") + + gs, err := s.gameServer() + if err != nil { + return nil, err + } + + s.gsUpdateMutex.RLock() + defer s.gsUpdateMutex.RUnlock() + + counter, ok := gs.Status.Counters[in.Name] + if !ok { + return nil, errors.Errorf("counter not found: %s", in.Name) + } + s.logger.WithField("Get Counter", counter).Debugf("Got Counter %s", in.Name) + protoCounter := alpha.Counter{Name: in.Name, Count: counter.Count, Capacity: counter.Capacity} + // If there are batched changes that have not yet been applied, apply them to the Counter. + // This does NOT validate batched the changes. + if counterUpdate, ok := s.gsCounterUpdates[in.Name]; ok { + if counterUpdate.capacitySet != nil { + protoCounter.Capacity = *counterUpdate.capacitySet + } + if counterUpdate.countSet != nil { + protoCounter.Count = *counterUpdate.countSet + } + protoCounter.Count += counterUpdate.diff + if protoCounter.Count < 0 { + protoCounter.Count = 0 + s.logger.Debug("truncating Count in Get Counter request to 0") + } + if protoCounter.Count > protoCounter.Capacity { + protoCounter.Count = protoCounter.Capacity + s.logger.Debug("truncating Count in Get Counter request to Capacity") + } + s.logger.WithField("Get Counter", counter).Debugf("Applied Batched Counter Updates %v", counterUpdate) + } + + return &protoCounter, nil } -// UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist. -// Returns INVALID_ARGUMENT if the FieldMask paths are invalid. +// UpdateCounter collapses all UpdateCounterRequests for a given Counter into a single request. +// Returns error if the Counter does not exist (name cannot be updated). +// Returns error if the Count is out of range [0,Capacity]. // [Stage:Alpha] // [FeatureFlag:CountsAndLists] func (s *SDKServer) UpdateCounter(ctx context.Context, in *alpha.UpdateCounterRequest) (*alpha.Counter, error) { if !runtime.FeatureEnabled(runtime.FeatureCountsAndLists) { return nil, errors.Errorf("%s not enabled", runtime.FeatureCountsAndLists) } - // TODO(#2716): Implement Me - return nil, errors.Errorf("Unimplemented -- UpdateCounter coming soon") + + if in.CounterUpdateRequest == nil { + return nil, errors.Errorf("invalid argument. CounterUpdateRequest: %v cannot be nil", in.CounterUpdateRequest) + } + + s.logger.WithField("name", in.CounterUpdateRequest.Name).Debug("Update Counter Request") + + gs, err := s.gameServer() + if err != nil { + return nil, err + } + + s.gsUpdateMutex.Lock() + defer s.gsUpdateMutex.Unlock() + + // Check if we already have a batch request started for this Counter. If not, add new request to + // the gsCounterUpdates map. + name := in.CounterUpdateRequest.Name + batchCounter := s.gsCounterUpdates[name] + + counter, ok := gs.Status.Counters[name] + // We didn't find the Counter named key in the gameserver. + if !ok { + return nil, errors.Errorf("counter not found: %s", name) + } + + batchCounter.counter = *counter.DeepCopy() + + switch { + case in.CounterUpdateRequest.CountDiff != 0: // Update based on if Client call is CountIncrement or CountDecrement + count := batchCounter.counter.Count + if batchCounter.countSet != nil { + count = *batchCounter.countSet + } + count += batchCounter.diff + in.CounterUpdateRequest.CountDiff + // Verify that 0 <= Count >= Capacity + capacity := batchCounter.counter.Capacity + if batchCounter.capacitySet != nil { + capacity = *batchCounter.capacitySet + } + if count < 0 || count > capacity { + return nil, errors.Errorf("out of range. Count must be within range [0,Capacity]. Found Count: %d, Capacity: %d", count, capacity) + } + batchCounter.diff += in.CounterUpdateRequest.CountDiff + case in.CounterUpdateRequest.Count != nil: // Update based on if Client call is CountSet + // Verify that 0 <= Count >= Capacity + countSet := in.CounterUpdateRequest.Count.GetValue() + capacity := batchCounter.counter.Capacity + if batchCounter.capacitySet != nil { + capacity = *batchCounter.capacitySet + } + if countSet < 0 || countSet > capacity { + return nil, errors.Errorf("out of range. Count must be within range [0,Capacity]. Found Count: %d, Capacity: %d", countSet, capacity) + } + batchCounter.countSet = &countSet + // Clear any previous CountIncrement or CountDecrement requests, and add the CountSet as the first item. + batchCounter.diff = 0 + case in.CounterUpdateRequest.Capacity != nil: // Updated based on if client call is CapacitySet + if in.CounterUpdateRequest.Capacity.GetValue() < 0 { + return nil, errors.Errorf("out of range. Capacity must be greater than or equal to 0. Found Capacity: %d", in.CounterUpdateRequest.Capacity.GetValue()) + } + capacitySet := in.CounterUpdateRequest.Capacity.GetValue() + batchCounter.capacitySet = &capacitySet + default: + return nil, errors.Errorf("invalid argument. Malformed CounterUpdateRequest: %v", in.CounterUpdateRequest) + } + + s.gsCounterUpdates[name] = batchCounter + + // Queue up the Update for later batch processing by updateCounters. + s.workerqueue.Enqueue(cache.ExplicitKey(updateCounters)) + return &alpha.Counter{}, nil +} + +// updateCounter updates the Counters in the GameServer's Status with the batched update requests. +func (s *SDKServer) updateCounter(ctx context.Context) error { + gs, err := s.gameServer() + if err != nil { + return err + } + gsCopy := gs.DeepCopy() + + s.logger.WithField("batchCounterUpdates", s.gsCounterUpdates).Debug("Batch updating Counter(s)") + s.gsUpdateMutex.Lock() + defer s.gsUpdateMutex.Unlock() + + names := []string{} + + for name, ctrReq := range s.gsCounterUpdates { + counter, ok := gsCopy.Status.Counters[name] + if !ok { + continue + } + // Changes may have been made to the Counter since we validated the incoming changes in + // UpdateCounter, and we need to verify if the batched changes can be fully applied, partially + // applied, or cannot be applied. + if ctrReq.capacitySet != nil { + counter.Capacity = *ctrReq.capacitySet + } + if ctrReq.countSet != nil { + counter.Count = *ctrReq.countSet + } + newCnt := counter.Count + ctrReq.diff + if newCnt < 0 { + newCnt = 0 + s.logger.Debug("truncating Count in Update Counter request to 0") + } + if newCnt > counter.Capacity { + newCnt = counter.Capacity + s.logger.Debug("truncating Count in Update Counter request to Capacity") + } + counter.Count = newCnt + gsCopy.Status.Counters[name] = counter + names = append(names, name) + } + + gs, err = s.gameServerGetter.GameServers(s.namespace).Update(ctx, gsCopy, metav1.UpdateOptions{}) + if err != nil { + return err + } + + // Record an event per update Counter + for _, name := range names { + s.recorder.Event(gs, corev1.EventTypeNormal, "UpdateCounter", + fmt.Sprintf("Counter %s updated to Count:%d Capacity:%d", + name, gs.Status.Counters[name].Count, gs.Status.Counters[name].Capacity)) + } + + // Cache a copy of the successfully updated gameserver + s.gsCopy = gs + // Clear the gsCounterUpdates + s.gsCounterUpdates = map[string]counterUpdateRequest{} + + return nil } // GetList returns a List. Returns NOT_FOUND if the List does not exist. diff --git a/pkg/sdkserver/sdkserver_test.go b/pkg/sdkserver/sdkserver_test.go index 5e89b7fbc4..a6f3d0c4ee 100644 --- a/pkg/sdkserver/sdkserver_test.go +++ b/pkg/sdkserver/sdkserver_test.go @@ -31,6 +31,7 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/types/known/wrapperspb" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/wait" @@ -1084,6 +1085,241 @@ func TestSDKServerReserveTimeout(t *testing.T) { wg.Wait() } +func TestSDKServerUpdateCounter(t *testing.T) { + t.Parallel() + agruntime.FeatureTestMutex.Lock() + defer agruntime.FeatureTestMutex.Unlock() + + err := agruntime.ParseFeatures(string(agruntime.FeatureCountsAndLists) + "=true") + require.NoError(t, err, "Can not parse FeatureCountsAndLists feature") + + counters := map[string]agonesv1.CounterStatus{ + "widgets": {Count: int64(10), Capacity: int64(100)}, + "foo": {Count: int64(10), Capacity: int64(100)}, + "bar": {Count: int64(10), Capacity: int64(100)}, + "baz": {Count: int64(10), Capacity: int64(100)}, + "bazel": {Count: int64(10), Capacity: int64(100)}, + "fish": {Count: int64(10), Capacity: int64(100)}, + "onefish": {Count: int64(10), Capacity: int64(100)}, + "twofish": {Count: int64(10), Capacity: int64(100)}, + "redfish": {Count: int64(10), Capacity: int64(100)}, + "bluefish": {Count: int64(10), Capacity: int64(100)}, + } + + fixtures := map[string]struct { + counterName string + requests []*alpha.UpdateCounterRequest + want agonesv1.CounterStatus + updateErrs []bool + updated bool + }{ + "increment": { + counterName: "widgets", + requests: []*alpha.UpdateCounterRequest{{ + CounterUpdateRequest: &alpha.CounterUpdateRequest{ + Name: "widgets", + CountDiff: 9, + }}}, + want: agonesv1.CounterStatus{Count: int64(19), Capacity: int64(100)}, + updateErrs: []bool{false}, + updated: true, + }, + "increment illegal": { + counterName: "widgets", + requests: []*alpha.UpdateCounterRequest{{ + CounterUpdateRequest: &alpha.CounterUpdateRequest{ + Name: "foo", + CountDiff: 100, + }}}, + want: agonesv1.CounterStatus{Count: int64(10), Capacity: int64(100)}, + updateErrs: []bool{true}, + updated: false, + }, + "decrement": { + counterName: "bar", + requests: []*alpha.UpdateCounterRequest{{ + CounterUpdateRequest: &alpha.CounterUpdateRequest{ + Name: "bar", + CountDiff: -1, + }}}, + want: agonesv1.CounterStatus{Count: int64(9), Capacity: int64(100)}, + updateErrs: []bool{false}, + updated: true, + }, + "decrement illegal": { + counterName: "baz", + requests: []*alpha.UpdateCounterRequest{{ + CounterUpdateRequest: &alpha.CounterUpdateRequest{ + Name: "baz", + CountDiff: -11, + }}}, + want: agonesv1.CounterStatus{Count: int64(10), Capacity: int64(100)}, + updateErrs: []bool{true}, + updated: false, + }, + "set capacity": { + counterName: "bazel", + requests: []*alpha.UpdateCounterRequest{{ + CounterUpdateRequest: &alpha.CounterUpdateRequest{ + Name: "bazel", + Capacity: wrapperspb.Int64(0), + }}}, + want: agonesv1.CounterStatus{Count: int64(0), Capacity: int64(0)}, + updateErrs: []bool{false}, + updated: true, + }, + "set capacity illegal": { + counterName: "fish", + requests: []*alpha.UpdateCounterRequest{{ + CounterUpdateRequest: &alpha.CounterUpdateRequest{ + Name: "fish", + Capacity: wrapperspb.Int64(-1), + }}}, + want: agonesv1.CounterStatus{Count: int64(10), Capacity: int64(100)}, + updateErrs: []bool{true}, + updated: false, + }, + "set count": { + counterName: "onefish", + requests: []*alpha.UpdateCounterRequest{{ + CounterUpdateRequest: &alpha.CounterUpdateRequest{ + Name: "onefish", + Count: wrapperspb.Int64(42), + }}}, + want: agonesv1.CounterStatus{Count: int64(42), Capacity: int64(100)}, + updateErrs: []bool{false}, + updated: true, + }, + "set count illegal": { + counterName: "twofish", + requests: []*alpha.UpdateCounterRequest{{ + CounterUpdateRequest: &alpha.CounterUpdateRequest{ + Name: "twofish", + Count: wrapperspb.Int64(101), + }}}, + want: agonesv1.CounterStatus{Count: int64(10), Capacity: int64(100)}, + updateErrs: []bool{true}, + updated: false, + }, + "increment past set capacity illegal": { + counterName: "redfish", + requests: []*alpha.UpdateCounterRequest{{ + CounterUpdateRequest: &alpha.CounterUpdateRequest{ + Name: "redfish", + Capacity: wrapperspb.Int64(0), + }}, + {CounterUpdateRequest: &alpha.CounterUpdateRequest{ + Name: "redfish", + CountDiff: 1, + }}}, + want: agonesv1.CounterStatus{Count: int64(0), Capacity: int64(0)}, + updateErrs: []bool{false, true}, + updated: true, + }, + "decrement past set capacity illegal": { + counterName: "bluefish", + requests: []*alpha.UpdateCounterRequest{{ + CounterUpdateRequest: &alpha.CounterUpdateRequest{ + Name: "bluefish", + Capacity: wrapperspb.Int64(0), + }}, + {CounterUpdateRequest: &alpha.CounterUpdateRequest{ + Name: "bluefish", + CountDiff: -1, + }}}, + want: agonesv1.CounterStatus{Count: int64(0), Capacity: int64(0)}, + updateErrs: []bool{false, true}, + updated: true, + }, + } + + for test, testCase := range fixtures { + t.Run(test, func(t *testing.T) { + m := agtesting.NewMocks() + + m.AgonesClient.AddReactor("list", "gameservers", func(action k8stesting.Action) (bool, runtime.Object, error) { + gs := agonesv1.GameServer{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test", Namespace: "default", Generation: 1, + }, + Spec: agonesv1.GameServerSpec{ + SdkServer: agonesv1.SdkServer{ + LogLevel: "Debug", + }, + }, + Status: agonesv1.GameServerStatus{ + Counters: counters, + }, + } + gs.ApplyDefaults() + return true, &agonesv1.GameServerList{Items: []agonesv1.GameServer{gs}}, nil + }) + + updated := make(chan map[string]agonesv1.CounterStatus, 10) + m.AgonesClient.AddReactor("update", "gameservers", func(action k8stesting.Action) (bool, runtime.Object, error) { + ua := action.(k8stesting.UpdateAction) + gs := ua.GetObject().(*agonesv1.GameServer) + gs.ObjectMeta.Generation++ + updated <- gs.Status.Counters + return true, gs, nil + }) + + ctx, cancel := context.WithCancel(context.Background()) + sc, err := defaultSidecar(m) + require.NoError(t, err) + assert.NoError(t, sc.WaitForConnection(ctx)) + sc.informerFactory.Start(ctx.Done()) + assert.True(t, cache.WaitForCacheSync(ctx.Done(), sc.gameServerSynced)) + + wg := sync.WaitGroup{} + wg.Add(1) + + go func() { + err = sc.Run(ctx) + assert.NoError(t, err) + wg.Done() + }() + + // check initial value comes through + require.Eventually(t, func() bool { + counter, err := sc.GetCounter(context.Background(), &alpha.GetCounterRequest{Name: testCase.counterName}) + return counter.Count == 10 && counter.Capacity == 100 && err == nil + }, 10*time.Second, time.Second) + + // Update the Counter + for i, req := range testCase.requests { + _, err = sc.UpdateCounter(context.Background(), req) + if testCase.updateErrs[i] { + assert.Error(t, err) + } else { + assert.NoError(t, err) + } + } + + got, err := sc.GetCounter(context.Background(), &alpha.GetCounterRequest{Name: testCase.counterName}) + assert.NoError(t, err) + assert.Equal(t, testCase.want.Count, got.Count) + assert.Equal(t, testCase.want.Capacity, got.Capacity) + + // on an update, confirm that the update hits the K8s api + if testCase.updated { + select { + case value := <-updated: + assert.NotNil(t, value[testCase.counterName]) + assert.Equal(t, + agonesv1.CounterStatus{Count: testCase.want.Count, Capacity: testCase.want.Capacity}, + value[testCase.counterName]) + case <-time.After(10 * time.Second): + assert.Fail(t, "Counter should have been updated") + } + } + + cancel() + wg.Wait() + }) + } +} + func TestSDKServerPlayerCapacity(t *testing.T) { t.Parallel() agruntime.FeatureTestMutex.Lock() diff --git a/proto/sdk/alpha/alpha.proto b/proto/sdk/alpha/alpha.proto index aeb9007cbd..00bf3ffff6 100644 --- a/proto/sdk/alpha/alpha.proto +++ b/proto/sdk/alpha/alpha.proto @@ -23,6 +23,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; +import "google/protobuf/wrappers.proto"; import "protoc-gen-openapiv2/options/annotations.proto"; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { @@ -138,15 +139,12 @@ service SDK { // UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated). // Returns OUT_OF_RANGE if the Count is out of range [0,Capacity]. - // Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the Counter. - // If a field mask path(s) is specified, but the value is not set in the request Counter object, - // then the default value for the variable will be set (i.e. 0 for "capacity" or "count"). rpc UpdateCounter(UpdateCounterRequest) returns (Counter) { option (google.api.http) = { - patch: "/v1alpha1/{counter.name=counters/*}" - body: "counter" + patch: "/v1alpha1/{counterUpdateRequest.name=counterUpdateRequests/*}" + body: "counterUpdateRequest" }; - option (google.api.method_signature) = "counter,update_mask"; + option (google.api.method_signature) = "counterUpdateRequest"; } // Gets a List. Returns NOT_FOUND if the List does not exist. @@ -229,6 +227,23 @@ message Counter { int64 capacity = 3; } +// A representation of a Counter Update Request. +message CounterUpdateRequest { + option (google.api.resource) = { + type: "agones.dev/CounterUpdateRequest" + pattern: "counterUpdateRequests/{counterUpdateRequest}" + }; + // The name of the Counter to update + string name = 1; + // The value to set the Counter Count + google.protobuf.Int64Value count = 2; + // The value to set the Counter Capacity + google.protobuf.Int64Value capacity = 3; + // countDiff tracks if a Counter Update Request is CountIncrement (positive), CountDecrement + // (negative), 0 if a CountSet or CapacitySet request + int64 countDiff = 4; +} + message GetCounterRequest { // The name of the Counter to get string name = 1 [ @@ -239,17 +254,12 @@ message GetCounterRequest { } message UpdateCounterRequest { - // The Counter to update - Counter counter = 1 [ + // The requested update to make to the Counter + CounterUpdateRequest counterUpdateRequest = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "agones.dev/Counter" + type: "agones.dev/CounterUpdateRequest" }]; - - // Required. Mask (list) of fields to update. - // Fields are specified relative to the Counter - // (e.g. `count`, `capacity`; *not* `Counter.count` or `Counter.capacity`). - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } // A representation of a List. diff --git a/sdks/csharp/sdk/generated/Alpha.cs b/sdks/csharp/sdk/generated/Alpha.cs index 5ab6658dfa..609d429bc1 100644 --- a/sdks/csharp/sdk/generated/Alpha.cs +++ b/sdks/csharp/sdk/generated/Alpha.cs @@ -43,66 +43,73 @@ static AlphaReflection() { "cGkvYW5ub3RhdGlvbnMucHJvdG8aF2dvb2dsZS9hcGkvY2xpZW50LnByb3Rv", "Gh9nb29nbGUvYXBpL2ZpZWxkX2JlaGF2aW9yLnByb3RvGhlnb29nbGUvYXBp", "L3Jlc291cmNlLnByb3RvGhtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8a", - "IGdvb2dsZS9wcm90b2J1Zi9maWVsZF9tYXNrLnByb3RvIgcKBUVtcHR5IhYK", - "BUNvdW50Eg0KBWNvdW50GAEgASgDIhQKBEJvb2wSDAoEYm9vbBgBIAEoCCIc", - "CghQbGF5ZXJJRBIQCghwbGF5ZXJJRBgBIAEoCSIcCgxQbGF5ZXJJRExpc3QS", - "DAoEbGlzdBgBIAMoCSJlCgdDb3VudGVyEgwKBG5hbWUYASABKAkSDQoFY291", - "bnQYAiABKAMSEAoIY2FwYWNpdHkYAyABKAM6K+pBKAoSYWdvbmVzLmRldi9D", - "b3VudGVyEhJjb3VudGVycy97Y291bnRlcn0iPQoRR2V0Q291bnRlclJlcXVl", - "c3QSKAoEbmFtZRgBIAEoCUIa4EEC+kEUChJhZ29uZXMuZGV2L0NvdW50ZXIi", - "mAEKFFVwZGF0ZUNvdW50ZXJSZXF1ZXN0EkoKB2NvdW50ZXIYASABKAsyHS5h", - "Z29uZXMuZGV2LnNkay5hbHBoYS5Db3VudGVyQhrgQQL6QRQKEmFnb25lcy5k", - "ZXYvQ291bnRlchI0Cgt1cGRhdGVfbWFzaxgCIAEoCzIaLmdvb2dsZS5wcm90", - "b2J1Zi5GaWVsZE1hc2tCA+BBAiJaCgRMaXN0EgwKBG5hbWUYASABKAkSEAoI", - "Y2FwYWNpdHkYAiABKAMSDgoGdmFsdWVzGAMgAygJOiLqQR8KD2Fnb25lcy5k", - "ZXYvTGlzdBIMbGlzdHMve2xpc3R9IjcKDkdldExpc3RSZXF1ZXN0EiUKBG5h", - "bWUYASABKAlCF+BBAvpBEQoPYWdvbmVzLmRldi9MaXN0IowBChFVcGRhdGVM", - "aXN0UmVxdWVzdBJBCgRsaXN0GAEgASgLMhouYWdvbmVzLmRldi5zZGsuYWxw", - "aGEuTGlzdEIX4EEC+kERCg9hZ29uZXMuZGV2L0xpc3QSNAoLdXBkYXRlX21h", - "c2sYAiABKAsyGi5nb29nbGUucHJvdG9idWYuRmllbGRNYXNrQgPgQQIiUAoT", - "QWRkTGlzdFZhbHVlUmVxdWVzdBIlCgRuYW1lGAEgASgJQhfgQQL6QREKD2Fn", - "b25lcy5kZXYvTGlzdBISCgV2YWx1ZRgCIAEoCUID4EECIlMKFlJlbW92ZUxp", - "c3RWYWx1ZVJlcXVlc3QSJQoEbmFtZRgBIAEoCUIX4EEC+kERCg9hZ29uZXMu", - "ZGV2L0xpc3QSEgoFdmFsdWUYAiABKAlCA+BBAjL0DAoDU0RLEm0KDVBsYXll", - "ckNvbm5lY3QSHi5hZ29uZXMuZGV2LnNkay5hbHBoYS5QbGF5ZXJJRBoaLmFn", - "b25lcy5kZXYuc2RrLmFscGhhLkJvb2wiIILT5JMCGiIVL2FscGhhL3BsYXll", - "ci9jb25uZWN0OgEqEnMKEFBsYXllckRpc2Nvbm5lY3QSHi5hZ29uZXMuZGV2", - "LnNkay5hbHBoYS5QbGF5ZXJJRBoaLmFnb25lcy5kZXYuc2RrLmFscGhhLkJv", - "b2wiI4LT5JMCHSIYL2FscGhhL3BsYXllci9kaXNjb25uZWN0OgEqEnAKEVNl", - "dFBsYXllckNhcGFjaXR5EhsuYWdvbmVzLmRldi5zZGsuYWxwaGEuQ291bnQa", - "Gy5hZ29uZXMuZGV2LnNkay5hbHBoYS5FbXB0eSIhgtPkkwIbGhYvYWxwaGEv", - "cGxheWVyL2NhcGFjaXR5OgEqEm0KEUdldFBsYXllckNhcGFjaXR5EhsuYWdv", - "bmVzLmRldi5zZGsuYWxwaGEuRW1wdHkaGy5hZ29uZXMuZGV2LnNkay5hbHBo", - "YS5Db3VudCIegtPkkwIYEhYvYWxwaGEvcGxheWVyL2NhcGFjaXR5EmcKDkdl", - "dFBsYXllckNvdW50EhsuYWdvbmVzLmRldi5zZGsuYWxwaGEuRW1wdHkaGy5h", - "Z29uZXMuZGV2LnNkay5hbHBoYS5Db3VudCIbgtPkkwIVEhMvYWxwaGEvcGxh", - "eWVyL2NvdW50EnsKEUlzUGxheWVyQ29ubmVjdGVkEh4uYWdvbmVzLmRldi5z", - "ZGsuYWxwaGEuUGxheWVySUQaGi5hZ29uZXMuZGV2LnNkay5hbHBoYS5Cb29s", - "IiqC0+STAiQSIi9hbHBoYS9wbGF5ZXIvY29ubmVjdGVkL3twbGF5ZXJJRH0S", - "dwoTR2V0Q29ubmVjdGVkUGxheWVycxIbLmFnb25lcy5kZXYuc2RrLmFscGhh", - "LkVtcHR5GiIuYWdvbmVzLmRldi5zZGsuYWxwaGEuUGxheWVySURMaXN0Ih+C", - "0+STAhkSFy9hbHBoYS9wbGF5ZXIvY29ubmVjdGVkEoABCgpHZXRDb3VudGVy", - "EicuYWdvbmVzLmRldi5zZGsuYWxwaGEuR2V0Q291bnRlclJlcXVlc3QaHS5h", - "Z29uZXMuZGV2LnNkay5hbHBoYS5Db3VudGVyIiqC0+STAh0SGy92MWFscGhh", - "MS97bmFtZT1jb3VudGVycy8qfdpBBG5hbWUSpgEKDVVwZGF0ZUNvdW50ZXIS", - "Ki5hZ29uZXMuZGV2LnNkay5hbHBoYS5VcGRhdGVDb3VudGVyUmVxdWVzdBod", - "LmFnb25lcy5kZXYuc2RrLmFscGhhLkNvdW50ZXIiSoLT5JMCLjIjL3YxYWxw", - "aGExL3tjb3VudGVyLm5hbWU9Y291bnRlcnMvKn06B2NvdW50ZXLaQRNjb3Vu", - "dGVyLHVwZGF0ZV9tYXNrEnQKB0dldExpc3QSJC5hZ29uZXMuZGV2LnNkay5h", - "bHBoYS5HZXRMaXN0UmVxdWVzdBoaLmFnb25lcy5kZXYuc2RrLmFscGhhLkxp", - "c3QiJ4LT5JMCGhIYL3YxYWxwaGExL3tuYW1lPWxpc3RzLyp92kEEbmFtZRKR", - "AQoKVXBkYXRlTGlzdBInLmFnb25lcy5kZXYuc2RrLmFscGhhLlVwZGF0ZUxp", - "c3RSZXF1ZXN0GhouYWdvbmVzLmRldi5zZGsuYWxwaGEuTGlzdCI+gtPkkwIl", - "Mh0vdjFhbHBoYTEve2xpc3QubmFtZT1saXN0cy8qfToEbGlzdNpBEGxpc3Qs", - "dXBkYXRlX21hc2sSgwEKDEFkZExpc3RWYWx1ZRIpLmFnb25lcy5kZXYuc2Rr", - "LmFscGhhLkFkZExpc3RWYWx1ZVJlcXVlc3QaGi5hZ29uZXMuZGV2LnNkay5h", - "bHBoYS5MaXN0IiyC0+STAiYiIS92MWFscGhhMS97bmFtZT1saXN0cy8qfTph", - "ZGRWYWx1ZToBKhKMAQoPUmVtb3ZlTGlzdFZhbHVlEiwuYWdvbmVzLmRldi5z", - "ZGsuYWxwaGEuUmVtb3ZlTGlzdFZhbHVlUmVxdWVzdBoaLmFnb25lcy5kZXYu", - "c2RrLmFscGhhLkxpc3QiL4LT5JMCKSIkL3YxYWxwaGExL3tuYW1lPWxpc3Rz", - "Lyp9OnJlbW92ZVZhbHVlOgEqQglaBy4vYWxwaGFiBnByb3RvMw==")); + "IGdvb2dsZS9wcm90b2J1Zi9maWVsZF9tYXNrLnByb3RvGh5nb29nbGUvcHJv", + "dG9idWYvd3JhcHBlcnMucHJvdG8iBwoFRW1wdHkiFgoFQ291bnQSDQoFY291", + "bnQYASABKAMiFAoEQm9vbBIMCgRib29sGAEgASgIIhwKCFBsYXllcklEEhAK", + "CHBsYXllcklEGAEgASgJIhwKDFBsYXllcklETGlzdBIMCgRsaXN0GAEgAygJ", + "ImUKB0NvdW50ZXISDAoEbmFtZRgBIAEoCRINCgVjb3VudBgCIAEoAxIQCghj", + "YXBhY2l0eRgDIAEoAzor6kEoChJhZ29uZXMuZGV2L0NvdW50ZXISEmNvdW50", + "ZXJzL3tjb3VudGVyfSLmAQoUQ291bnRlclVwZGF0ZVJlcXVlc3QSDAoEbmFt", + "ZRgBIAEoCRIqCgVjb3VudBgCIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5JbnQ2", + "NFZhbHVlEi0KCGNhcGFjaXR5GAMgASgLMhsuZ29vZ2xlLnByb3RvYnVmLklu", + "dDY0VmFsdWUSEQoJY291bnREaWZmGAQgASgDOlLqQU8KH2Fnb25lcy5kZXYv", + "Q291bnRlclVwZGF0ZVJlcXVlc3QSLGNvdW50ZXJVcGRhdGVSZXF1ZXN0cy97", + "Y291bnRlclVwZGF0ZVJlcXVlc3R9Ij0KEUdldENvdW50ZXJSZXF1ZXN0EigK", + "BG5hbWUYASABKAlCGuBBAvpBFAoSYWdvbmVzLmRldi9Db3VudGVyIokBChRV", + "cGRhdGVDb3VudGVyUmVxdWVzdBJxChRjb3VudGVyVXBkYXRlUmVxdWVzdBgB", + "IAEoCzIqLmFnb25lcy5kZXYuc2RrLmFscGhhLkNvdW50ZXJVcGRhdGVSZXF1", + "ZXN0QifgQQL6QSEKH2Fnb25lcy5kZXYvQ291bnRlclVwZGF0ZVJlcXVlc3Qi", + "WgoETGlzdBIMCgRuYW1lGAEgASgJEhAKCGNhcGFjaXR5GAIgASgDEg4KBnZh", + "bHVlcxgDIAMoCToi6kEfCg9hZ29uZXMuZGV2L0xpc3QSDGxpc3RzL3tsaXN0", + "fSI3Cg5HZXRMaXN0UmVxdWVzdBIlCgRuYW1lGAEgASgJQhfgQQL6QREKD2Fn", + "b25lcy5kZXYvTGlzdCKMAQoRVXBkYXRlTGlzdFJlcXVlc3QSQQoEbGlzdBgB", + "IAEoCzIaLmFnb25lcy5kZXYuc2RrLmFscGhhLkxpc3RCF+BBAvpBEQoPYWdv", + "bmVzLmRldi9MaXN0EjQKC3VwZGF0ZV9tYXNrGAIgASgLMhouZ29vZ2xlLnBy", + "b3RvYnVmLkZpZWxkTWFza0ID4EECIlAKE0FkZExpc3RWYWx1ZVJlcXVlc3QS", + "JQoEbmFtZRgBIAEoCUIX4EEC+kERCg9hZ29uZXMuZGV2L0xpc3QSEgoFdmFs", + "dWUYAiABKAlCA+BBAiJTChZSZW1vdmVMaXN0VmFsdWVSZXF1ZXN0EiUKBG5h", + "bWUYASABKAlCF+BBAvpBEQoPYWdvbmVzLmRldi9MaXN0EhIKBXZhbHVlGAIg", + "ASgJQgPgQQIynA0KA1NESxJtCg1QbGF5ZXJDb25uZWN0Eh4uYWdvbmVzLmRl", + "di5zZGsuYWxwaGEuUGxheWVySUQaGi5hZ29uZXMuZGV2LnNkay5hbHBoYS5C", + "b29sIiCC0+STAhoiFS9hbHBoYS9wbGF5ZXIvY29ubmVjdDoBKhJzChBQbGF5", + "ZXJEaXNjb25uZWN0Eh4uYWdvbmVzLmRldi5zZGsuYWxwaGEuUGxheWVySUQa", + "Gi5hZ29uZXMuZGV2LnNkay5hbHBoYS5Cb29sIiOC0+STAh0iGC9hbHBoYS9w", + "bGF5ZXIvZGlzY29ubmVjdDoBKhJwChFTZXRQbGF5ZXJDYXBhY2l0eRIbLmFn", + "b25lcy5kZXYuc2RrLmFscGhhLkNvdW50GhsuYWdvbmVzLmRldi5zZGsuYWxw", + "aGEuRW1wdHkiIYLT5JMCGxoWL2FscGhhL3BsYXllci9jYXBhY2l0eToBKhJt", + "ChFHZXRQbGF5ZXJDYXBhY2l0eRIbLmFnb25lcy5kZXYuc2RrLmFscGhhLkVt", + "cHR5GhsuYWdvbmVzLmRldi5zZGsuYWxwaGEuQ291bnQiHoLT5JMCGBIWL2Fs", + "cGhhL3BsYXllci9jYXBhY2l0eRJnCg5HZXRQbGF5ZXJDb3VudBIbLmFnb25l", + "cy5kZXYuc2RrLmFscGhhLkVtcHR5GhsuYWdvbmVzLmRldi5zZGsuYWxwaGEu", + "Q291bnQiG4LT5JMCFRITL2FscGhhL3BsYXllci9jb3VudBJ7ChFJc1BsYXll", + "ckNvbm5lY3RlZBIeLmFnb25lcy5kZXYuc2RrLmFscGhhLlBsYXllcklEGhou", + "YWdvbmVzLmRldi5zZGsuYWxwaGEuQm9vbCIqgtPkkwIkEiIvYWxwaGEvcGxh", + "eWVyL2Nvbm5lY3RlZC97cGxheWVySUR9EncKE0dldENvbm5lY3RlZFBsYXll", + "cnMSGy5hZ29uZXMuZGV2LnNkay5hbHBoYS5FbXB0eRoiLmFnb25lcy5kZXYu", + "c2RrLmFscGhhLlBsYXllcklETGlzdCIfgtPkkwIZEhcvYWxwaGEvcGxheWVy", + "L2Nvbm5lY3RlZBKAAQoKR2V0Q291bnRlchInLmFnb25lcy5kZXYuc2RrLmFs", + "cGhhLkdldENvdW50ZXJSZXF1ZXN0Gh0uYWdvbmVzLmRldi5zZGsuYWxwaGEu", + "Q291bnRlciIqgtPkkwIdEhsvdjFhbHBoYTEve25hbWU9Y291bnRlcnMvKn3a", + "QQRuYW1lEs4BCg1VcGRhdGVDb3VudGVyEiouYWdvbmVzLmRldi5zZGsuYWxw", + "aGEuVXBkYXRlQ291bnRlclJlcXVlc3QaHS5hZ29uZXMuZGV2LnNkay5hbHBo", + "YS5Db3VudGVyInKC0+STAlUyPS92MWFscGhhMS97Y291bnRlclVwZGF0ZVJl", + "cXVlc3QubmFtZT1jb3VudGVyVXBkYXRlUmVxdWVzdHMvKn06FGNvdW50ZXJV", + "cGRhdGVSZXF1ZXN02kEUY291bnRlclVwZGF0ZVJlcXVlc3QSdAoHR2V0TGlz", + "dBIkLmFnb25lcy5kZXYuc2RrLmFscGhhLkdldExpc3RSZXF1ZXN0GhouYWdv", + "bmVzLmRldi5zZGsuYWxwaGEuTGlzdCIngtPkkwIaEhgvdjFhbHBoYTEve25h", + "bWU9bGlzdHMvKn3aQQRuYW1lEpEBCgpVcGRhdGVMaXN0EicuYWdvbmVzLmRl", + "di5zZGsuYWxwaGEuVXBkYXRlTGlzdFJlcXVlc3QaGi5hZ29uZXMuZGV2LnNk", + "ay5hbHBoYS5MaXN0Ij6C0+STAiUyHS92MWFscGhhMS97bGlzdC5uYW1lPWxp", + "c3RzLyp9OgRsaXN02kEQbGlzdCx1cGRhdGVfbWFzaxKDAQoMQWRkTGlzdFZh", + "bHVlEikuYWdvbmVzLmRldi5zZGsuYWxwaGEuQWRkTGlzdFZhbHVlUmVxdWVz", + "dBoaLmFnb25lcy5kZXYuc2RrLmFscGhhLkxpc3QiLILT5JMCJiIhL3YxYWxw", + "aGExL3tuYW1lPWxpc3RzLyp9OmFkZFZhbHVlOgEqEowBCg9SZW1vdmVMaXN0", + "VmFsdWUSLC5hZ29uZXMuZGV2LnNkay5hbHBoYS5SZW1vdmVMaXN0VmFsdWVS", + "ZXF1ZXN0GhouYWdvbmVzLmRldi5zZGsuYWxwaGEuTGlzdCIvgtPkkwIpIiQv", + "djFhbHBoYTEve25hbWU9bGlzdHMvKn06cmVtb3ZlVmFsdWU6ASpCCVoHLi9h", + "bHBoYWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Google.Api.AnnotationsReflection.Descriptor, global::Google.Api.ClientReflection.Descriptor, global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Api.ResourceReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor, }, + new pbr::FileDescriptor[] { global::Google.Api.AnnotationsReflection.Descriptor, global::Google.Api.ClientReflection.Descriptor, global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Api.ResourceReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Agones.Dev.Sdk.Alpha.Empty), global::Agones.Dev.Sdk.Alpha.Empty.Parser, null, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Agones.Dev.Sdk.Alpha.Count), global::Agones.Dev.Sdk.Alpha.Count.Parser, new[]{ "Count_" }, null, null, null, null), @@ -110,8 +117,9 @@ static AlphaReflection() { new pbr::GeneratedClrTypeInfo(typeof(global::Agones.Dev.Sdk.Alpha.PlayerID), global::Agones.Dev.Sdk.Alpha.PlayerID.Parser, new[]{ "PlayerID_" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Agones.Dev.Sdk.Alpha.PlayerIDList), global::Agones.Dev.Sdk.Alpha.PlayerIDList.Parser, new[]{ "List" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Agones.Dev.Sdk.Alpha.Counter), global::Agones.Dev.Sdk.Alpha.Counter.Parser, new[]{ "Name", "Count", "Capacity" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Agones.Dev.Sdk.Alpha.CounterUpdateRequest), global::Agones.Dev.Sdk.Alpha.CounterUpdateRequest.Parser, new[]{ "Name", "Count", "Capacity", "CountDiff" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Agones.Dev.Sdk.Alpha.GetCounterRequest), global::Agones.Dev.Sdk.Alpha.GetCounterRequest.Parser, new[]{ "Name" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Agones.Dev.Sdk.Alpha.UpdateCounterRequest), global::Agones.Dev.Sdk.Alpha.UpdateCounterRequest.Parser, new[]{ "Counter", "UpdateMask" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Agones.Dev.Sdk.Alpha.UpdateCounterRequest), global::Agones.Dev.Sdk.Alpha.UpdateCounterRequest.Parser, new[]{ "CounterUpdateRequest" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Agones.Dev.Sdk.Alpha.List), global::Agones.Dev.Sdk.Alpha.List.Parser, new[]{ "Name", "Capacity", "Values" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Agones.Dev.Sdk.Alpha.GetListRequest), global::Agones.Dev.Sdk.Alpha.GetListRequest.Parser, new[]{ "Name" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Agones.Dev.Sdk.Alpha.UpdateListRequest), global::Agones.Dev.Sdk.Alpha.UpdateListRequest.Parser, new[]{ "List", "UpdateMask" }, null, null, null, null), @@ -1310,6 +1318,338 @@ public void MergeFrom(pb::CodedInputStream input) { } + /// + /// A representation of a Counter Update Request. + /// + public sealed partial class CounterUpdateRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CounterUpdateRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Agones.Dev.Sdk.Alpha.AlphaReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CounterUpdateRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CounterUpdateRequest(CounterUpdateRequest other) : this() { + name_ = other.name_; + Count = other.Count; + Capacity = other.Capacity; + countDiff_ = other.countDiff_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CounterUpdateRequest Clone() { + return new CounterUpdateRequest(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + /// + /// The name of the Counter to update + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "count" field. + public const int CountFieldNumber = 2; + private static readonly pb::FieldCodec _single_count_codec = pb::FieldCodec.ForStructWrapper(18); + private long? count_; + /// + /// The value to set the Counter Count + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long? Count { + get { return count_; } + set { + count_ = value; + } + } + + + /// Field number for the "capacity" field. + public const int CapacityFieldNumber = 3; + private static readonly pb::FieldCodec _single_capacity_codec = pb::FieldCodec.ForStructWrapper(26); + private long? capacity_; + /// + /// The value to set the Counter Capacity + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long? Capacity { + get { return capacity_; } + set { + capacity_ = value; + } + } + + + /// Field number for the "countDiff" field. + public const int CountDiffFieldNumber = 4; + private long countDiff_; + /// + /// countDiff tracks if a Counter Update Request is CountIncrement (positive), CountDecrement + /// (negative), 0 if a CountSet or CapacitySet request + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long CountDiff { + get { return countDiff_; } + set { + countDiff_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CounterUpdateRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CounterUpdateRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (Count != other.Count) return false; + if (Capacity != other.Capacity) return false; + if (CountDiff != other.CountDiff) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (count_ != null) hash ^= Count.GetHashCode(); + if (capacity_ != null) hash ^= Capacity.GetHashCode(); + if (CountDiff != 0L) hash ^= CountDiff.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (count_ != null) { + _single_count_codec.WriteTagAndValue(output, Count); + } + if (capacity_ != null) { + _single_capacity_codec.WriteTagAndValue(output, Capacity); + } + if (CountDiff != 0L) { + output.WriteRawTag(32); + output.WriteInt64(CountDiff); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (count_ != null) { + _single_count_codec.WriteTagAndValue(ref output, Count); + } + if (capacity_ != null) { + _single_capacity_codec.WriteTagAndValue(ref output, Capacity); + } + if (CountDiff != 0L) { + output.WriteRawTag(32); + output.WriteInt64(CountDiff); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (count_ != null) { + size += _single_count_codec.CalculateSizeWithTag(Count); + } + if (capacity_ != null) { + size += _single_capacity_codec.CalculateSizeWithTag(Capacity); + } + if (CountDiff != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(CountDiff); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CounterUpdateRequest other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.count_ != null) { + if (count_ == null || other.Count != 0L) { + Count = other.Count; + } + } + if (other.capacity_ != null) { + if (capacity_ == null || other.Capacity != 0L) { + Capacity = other.Capacity; + } + } + if (other.CountDiff != 0L) { + CountDiff = other.CountDiff; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + long? value = _single_count_codec.Read(input); + if (count_ == null || value != 0L) { + Count = value; + } + break; + } + case 26: { + long? value = _single_capacity_codec.Read(input); + if (capacity_ == null || value != 0L) { + Capacity = value; + } + break; + } + case 32: { + CountDiff = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + long? value = _single_count_codec.Read(ref input); + if (count_ == null || value != 0L) { + Count = value; + } + break; + } + case 26: { + long? value = _single_capacity_codec.Read(ref input); + if (capacity_ == null || value != 0L) { + Capacity = value; + } + break; + } + case 32: { + CountDiff = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + public sealed partial class GetCounterRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -1324,7 +1664,7 @@ public sealed partial class GetCounterRequest : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Agones.Dev.Sdk.Alpha.AlphaReflection.Descriptor.MessageTypes[6]; } + get { return global::Agones.Dev.Sdk.Alpha.AlphaReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1516,7 +1856,7 @@ public sealed partial class UpdateCounterRequest : pb::IMessageField number for the "counter" field. - public const int CounterFieldNumber = 1; - private global::Agones.Dev.Sdk.Alpha.Counter counter_; + /// Field number for the "counterUpdateRequest" field. + public const int CounterUpdateRequestFieldNumber = 1; + private global::Agones.Dev.Sdk.Alpha.CounterUpdateRequest counterUpdateRequest_; /// - /// The Counter to update + /// The requested update to make to the Counter /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Agones.Dev.Sdk.Alpha.Counter Counter { - get { return counter_; } + public global::Agones.Dev.Sdk.Alpha.CounterUpdateRequest CounterUpdateRequest { + get { return counterUpdateRequest_; } set { - counter_ = value; - } - } - - /// Field number for the "update_mask" field. - public const int UpdateMaskFieldNumber = 2; - private global::Google.Protobuf.WellKnownTypes.FieldMask updateMask_; - /// - /// Required. Mask (list) of fields to update. - /// Fields are specified relative to the Counter - /// (e.g. `count`, `capacity`; *not* `Counter.count` or `Counter.capacity`). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Google.Protobuf.WellKnownTypes.FieldMask UpdateMask { - get { return updateMask_; } - set { - updateMask_ = value; + counterUpdateRequest_ = value; } } @@ -1594,8 +1916,7 @@ public bool Equals(UpdateCounterRequest other) { if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Counter, other.Counter)) return false; - if (!object.Equals(UpdateMask, other.UpdateMask)) return false; + if (!object.Equals(CounterUpdateRequest, other.CounterUpdateRequest)) return false; return Equals(_unknownFields, other._unknownFields); } @@ -1603,8 +1924,7 @@ public bool Equals(UpdateCounterRequest other) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (counter_ != null) hash ^= Counter.GetHashCode(); - if (updateMask_ != null) hash ^= UpdateMask.GetHashCode(); + if (counterUpdateRequest_ != null) hash ^= CounterUpdateRequest.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1623,13 +1943,9 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (counter_ != null) { + if (counterUpdateRequest_ != null) { output.WriteRawTag(10); - output.WriteMessage(Counter); - } - if (updateMask_ != null) { - output.WriteRawTag(18); - output.WriteMessage(UpdateMask); + output.WriteMessage(CounterUpdateRequest); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -1641,13 +1957,9 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (counter_ != null) { + if (counterUpdateRequest_ != null) { output.WriteRawTag(10); - output.WriteMessage(Counter); - } - if (updateMask_ != null) { - output.WriteRawTag(18); - output.WriteMessage(UpdateMask); + output.WriteMessage(CounterUpdateRequest); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -1659,11 +1971,8 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (counter_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Counter); - } - if (updateMask_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(UpdateMask); + if (counterUpdateRequest_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CounterUpdateRequest); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -1677,17 +1986,11 @@ public void MergeFrom(UpdateCounterRequest other) { if (other == null) { return; } - if (other.counter_ != null) { - if (counter_ == null) { - Counter = new global::Agones.Dev.Sdk.Alpha.Counter(); + if (other.counterUpdateRequest_ != null) { + if (counterUpdateRequest_ == null) { + CounterUpdateRequest = new global::Agones.Dev.Sdk.Alpha.CounterUpdateRequest(); } - Counter.MergeFrom(other.Counter); - } - if (other.updateMask_ != null) { - if (updateMask_ == null) { - UpdateMask = new global::Google.Protobuf.WellKnownTypes.FieldMask(); - } - UpdateMask.MergeFrom(other.UpdateMask); + CounterUpdateRequest.MergeFrom(other.CounterUpdateRequest); } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1705,17 +2008,10 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (counter_ == null) { - Counter = new global::Agones.Dev.Sdk.Alpha.Counter(); + if (counterUpdateRequest_ == null) { + CounterUpdateRequest = new global::Agones.Dev.Sdk.Alpha.CounterUpdateRequest(); } - input.ReadMessage(Counter); - break; - } - case 18: { - if (updateMask_ == null) { - UpdateMask = new global::Google.Protobuf.WellKnownTypes.FieldMask(); - } - input.ReadMessage(UpdateMask); + input.ReadMessage(CounterUpdateRequest); break; } } @@ -1734,17 +2030,10 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - if (counter_ == null) { - Counter = new global::Agones.Dev.Sdk.Alpha.Counter(); - } - input.ReadMessage(Counter); - break; - } - case 18: { - if (updateMask_ == null) { - UpdateMask = new global::Google.Protobuf.WellKnownTypes.FieldMask(); + if (counterUpdateRequest_ == null) { + CounterUpdateRequest = new global::Agones.Dev.Sdk.Alpha.CounterUpdateRequest(); } - input.ReadMessage(UpdateMask); + input.ReadMessage(CounterUpdateRequest); break; } } @@ -1771,7 +2060,7 @@ public sealed partial class List : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Agones.Dev.Sdk.Alpha.AlphaReflection.Descriptor.MessageTypes[8]; } + get { return global::Agones.Dev.Sdk.Alpha.AlphaReflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2032,7 +2321,7 @@ public sealed partial class GetListRequest : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Agones.Dev.Sdk.Alpha.AlphaReflection.Descriptor.MessageTypes[9]; } + get { return global::Agones.Dev.Sdk.Alpha.AlphaReflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2224,7 +2513,7 @@ public sealed partial class UpdateListRequest : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Agones.Dev.Sdk.Alpha.AlphaReflection.Descriptor.MessageTypes[10]; } + get { return global::Agones.Dev.Sdk.Alpha.AlphaReflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2476,7 +2765,7 @@ public sealed partial class AddListValueRequest : pb::IMessage /// UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated). /// Returns OUT_OF_RANGE if the Count is out of range [0,Capacity]. - /// Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the Counter. - /// If a field mask path(s) is specified, but the value is not set in the request Counter object, - /// then the default value for the variable will be set (i.e. 0 for "capacity" or "count"). /// /// The request received from the client. /// The context of the server-side call handler being invoked. @@ -998,9 +995,6 @@ protected SDKClient(ClientBaseConfiguration configuration) : base(configuration) /// /// UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated). /// Returns OUT_OF_RANGE if the Count is out of range [0,Capacity]. - /// Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the Counter. - /// If a field mask path(s) is specified, but the value is not set in the request Counter object, - /// then the default value for the variable will be set (i.e. 0 for "capacity" or "count"). /// /// The request to send to the server. /// The initial metadata to send with the call. This parameter is optional. @@ -1015,9 +1009,6 @@ protected SDKClient(ClientBaseConfiguration configuration) : base(configuration) /// /// UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated). /// Returns OUT_OF_RANGE if the Count is out of range [0,Capacity]. - /// Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the Counter. - /// If a field mask path(s) is specified, but the value is not set in the request Counter object, - /// then the default value for the variable will be set (i.e. 0 for "capacity" or "count"). /// /// The request to send to the server. /// The options for the call. @@ -1030,9 +1021,6 @@ protected SDKClient(ClientBaseConfiguration configuration) : base(configuration) /// /// UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated). /// Returns OUT_OF_RANGE if the Count is out of range [0,Capacity]. - /// Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the Counter. - /// If a field mask path(s) is specified, but the value is not set in the request Counter object, - /// then the default value for the variable will be set (i.e. 0 for "capacity" or "count"). /// /// The request to send to the server. /// The initial metadata to send with the call. This parameter is optional. @@ -1047,9 +1035,6 @@ protected SDKClient(ClientBaseConfiguration configuration) : base(configuration) /// /// UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated). /// Returns OUT_OF_RANGE if the Count is out of range [0,Capacity]. - /// Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the Counter. - /// If a field mask path(s) is specified, but the value is not set in the request Counter object, - /// then the default value for the variable will be set (i.e. 0 for "capacity" or "count"). /// /// The request to send to the server. /// The options for the call. diff --git a/sdks/nodejs/lib/alpha/alpha_grpc_pb.js b/sdks/nodejs/lib/alpha/alpha_grpc_pb.js index 3fb4e06f06..7958d8a95f 100644 --- a/sdks/nodejs/lib/alpha/alpha_grpc_pb.js +++ b/sdks/nodejs/lib/alpha/alpha_grpc_pb.js @@ -38,6 +38,7 @@ var google_api_field_behavior_pb = require('./google/api/field_behavior_pb.js'); var google_api_resource_pb = require('./google/api/resource_pb.js'); var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); var google_protobuf_field_mask_pb = require('google-protobuf/google/protobuf/field_mask_pb.js'); +var google_protobuf_wrappers_pb = require('google-protobuf/google/protobuf/wrappers_pb.js'); var protoc$gen$openapiv2_options_annotations_pb = require('./protoc-gen-openapiv2/options/annotations_pb.js'); function serialize_agones_dev_sdk_alpha_AddListValueRequest(arg) { @@ -323,9 +324,6 @@ getCounter: { }, // UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated). // Returns OUT_OF_RANGE if the Count is out of range [0,Capacity]. -// Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the Counter. -// If a field mask path(s) is specified, but the value is not set in the request Counter object, -// then the default value for the variable will be set (i.e. 0 for "capacity" or "count"). updateCounter: { path: '/agones.dev.sdk.alpha.SDK/UpdateCounter', requestStream: false, diff --git a/sdks/nodejs/lib/alpha/alpha_pb.js b/sdks/nodejs/lib/alpha/alpha_pb.js index 2604aaf6e2..9a1989dd80 100644 --- a/sdks/nodejs/lib/alpha/alpha_pb.js +++ b/sdks/nodejs/lib/alpha/alpha_pb.js @@ -42,12 +42,15 @@ var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb goog.object.extend(proto, google_protobuf_empty_pb); var google_protobuf_field_mask_pb = require('google-protobuf/google/protobuf/field_mask_pb.js'); goog.object.extend(proto, google_protobuf_field_mask_pb); +var google_protobuf_wrappers_pb = require('google-protobuf/google/protobuf/wrappers_pb.js'); +goog.object.extend(proto, google_protobuf_wrappers_pb); var protoc$gen$openapiv2_options_annotations_pb = require('./protoc-gen-openapiv2/options/annotations_pb.js'); goog.object.extend(proto, protoc$gen$openapiv2_options_annotations_pb); goog.exportSymbol('proto.agones.dev.sdk.alpha.AddListValueRequest', null, global); goog.exportSymbol('proto.agones.dev.sdk.alpha.Bool', null, global); goog.exportSymbol('proto.agones.dev.sdk.alpha.Count', null, global); goog.exportSymbol('proto.agones.dev.sdk.alpha.Counter', null, global); +goog.exportSymbol('proto.agones.dev.sdk.alpha.CounterUpdateRequest', null, global); goog.exportSymbol('proto.agones.dev.sdk.alpha.Empty', null, global); goog.exportSymbol('proto.agones.dev.sdk.alpha.GetCounterRequest', null, global); goog.exportSymbol('proto.agones.dev.sdk.alpha.GetListRequest', null, global); @@ -183,6 +186,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.agones.dev.sdk.alpha.Counter.displayName = 'proto.agones.dev.sdk.alpha.Counter'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.agones.dev.sdk.alpha.CounterUpdateRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.agones.dev.sdk.alpha.CounterUpdateRequest.displayName = 'proto.agones.dev.sdk.alpha.CounterUpdateRequest'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -1170,6 +1194,268 @@ proto.agones.dev.sdk.alpha.Counter.prototype.setCapacity = function(value) { +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.prototype.toObject = function(opt_includeInstance) { + return proto.agones.dev.sdk.alpha.CounterUpdateRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.agones.dev.sdk.alpha.CounterUpdateRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + count: (f = msg.getCount()) && google_protobuf_wrappers_pb.Int64Value.toObject(includeInstance, f), + capacity: (f = msg.getCapacity()) && google_protobuf_wrappers_pb.Int64Value.toObject(includeInstance, f), + countdiff: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.agones.dev.sdk.alpha.CounterUpdateRequest} + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.agones.dev.sdk.alpha.CounterUpdateRequest; + return proto.agones.dev.sdk.alpha.CounterUpdateRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.agones.dev.sdk.alpha.CounterUpdateRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.agones.dev.sdk.alpha.CounterUpdateRequest} + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = new google_protobuf_wrappers_pb.Int64Value; + reader.readMessage(value,google_protobuf_wrappers_pb.Int64Value.deserializeBinaryFromReader); + msg.setCount(value); + break; + case 3: + var value = new google_protobuf_wrappers_pb.Int64Value; + reader.readMessage(value,google_protobuf_wrappers_pb.Int64Value.deserializeBinaryFromReader); + msg.setCapacity(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setCountdiff(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.agones.dev.sdk.alpha.CounterUpdateRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.agones.dev.sdk.alpha.CounterUpdateRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getCount(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_wrappers_pb.Int64Value.serializeBinaryToWriter + ); + } + f = message.getCapacity(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_wrappers_pb.Int64Value.serializeBinaryToWriter + ); + } + f = message.getCountdiff(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.agones.dev.sdk.alpha.CounterUpdateRequest} returns this + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Int64Value count = 2; + * @return {?proto.google.protobuf.Int64Value} + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.prototype.getCount = function() { + return /** @type{?proto.google.protobuf.Int64Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.Int64Value, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Int64Value|undefined} value + * @return {!proto.agones.dev.sdk.alpha.CounterUpdateRequest} returns this +*/ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.prototype.setCount = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.agones.dev.sdk.alpha.CounterUpdateRequest} returns this + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.prototype.clearCount = function() { + return this.setCount(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.prototype.hasCount = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional google.protobuf.Int64Value capacity = 3; + * @return {?proto.google.protobuf.Int64Value} + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.prototype.getCapacity = function() { + return /** @type{?proto.google.protobuf.Int64Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.Int64Value, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Int64Value|undefined} value + * @return {!proto.agones.dev.sdk.alpha.CounterUpdateRequest} returns this +*/ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.prototype.setCapacity = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.agones.dev.sdk.alpha.CounterUpdateRequest} returns this + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.prototype.clearCapacity = function() { + return this.setCapacity(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.prototype.hasCapacity = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional int64 countDiff = 4; + * @return {number} + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.prototype.getCountdiff = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.agones.dev.sdk.alpha.CounterUpdateRequest} returns this + */ +proto.agones.dev.sdk.alpha.CounterUpdateRequest.prototype.setCountdiff = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. @@ -1329,8 +1615,7 @@ proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.toObject = function(op */ proto.agones.dev.sdk.alpha.UpdateCounterRequest.toObject = function(includeInstance, msg) { var f, obj = { - counter: (f = msg.getCounter()) && proto.agones.dev.sdk.alpha.Counter.toObject(includeInstance, f), - updateMask: (f = msg.getUpdateMask()) && google_protobuf_field_mask_pb.FieldMask.toObject(includeInstance, f) + counterupdaterequest: (f = msg.getCounterupdaterequest()) && proto.agones.dev.sdk.alpha.CounterUpdateRequest.toObject(includeInstance, f) }; if (includeInstance) { @@ -1368,14 +1653,9 @@ proto.agones.dev.sdk.alpha.UpdateCounterRequest.deserializeBinaryFromReader = fu var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.agones.dev.sdk.alpha.Counter; - reader.readMessage(value,proto.agones.dev.sdk.alpha.Counter.deserializeBinaryFromReader); - msg.setCounter(value); - break; - case 2: - var value = new google_protobuf_field_mask_pb.FieldMask; - reader.readMessage(value,google_protobuf_field_mask_pb.FieldMask.deserializeBinaryFromReader); - msg.setUpdateMask(value); + var value = new proto.agones.dev.sdk.alpha.CounterUpdateRequest; + reader.readMessage(value,proto.agones.dev.sdk.alpha.CounterUpdateRequest.deserializeBinaryFromReader); + msg.setCounterupdaterequest(value); break; default: reader.skipField(); @@ -1406,40 +1686,32 @@ proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.serializeBinary = func */ proto.agones.dev.sdk.alpha.UpdateCounterRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getCounter(); + f = message.getCounterupdaterequest(); if (f != null) { writer.writeMessage( 1, f, - proto.agones.dev.sdk.alpha.Counter.serializeBinaryToWriter - ); - } - f = message.getUpdateMask(); - if (f != null) { - writer.writeMessage( - 2, - f, - google_protobuf_field_mask_pb.FieldMask.serializeBinaryToWriter + proto.agones.dev.sdk.alpha.CounterUpdateRequest.serializeBinaryToWriter ); } }; /** - * optional Counter counter = 1; - * @return {?proto.agones.dev.sdk.alpha.Counter} + * optional CounterUpdateRequest counterUpdateRequest = 1; + * @return {?proto.agones.dev.sdk.alpha.CounterUpdateRequest} */ -proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.getCounter = function() { - return /** @type{?proto.agones.dev.sdk.alpha.Counter} */ ( - jspb.Message.getWrapperField(this, proto.agones.dev.sdk.alpha.Counter, 1)); +proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.getCounterupdaterequest = function() { + return /** @type{?proto.agones.dev.sdk.alpha.CounterUpdateRequest} */ ( + jspb.Message.getWrapperField(this, proto.agones.dev.sdk.alpha.CounterUpdateRequest, 1)); }; /** - * @param {?proto.agones.dev.sdk.alpha.Counter|undefined} value + * @param {?proto.agones.dev.sdk.alpha.CounterUpdateRequest|undefined} value * @return {!proto.agones.dev.sdk.alpha.UpdateCounterRequest} returns this */ -proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.setCounter = function(value) { +proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.setCounterupdaterequest = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; @@ -1448,8 +1720,8 @@ proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.setCounter = function( * Clears the message field making it undefined. * @return {!proto.agones.dev.sdk.alpha.UpdateCounterRequest} returns this */ -proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.clearCounter = function() { - return this.setCounter(undefined); +proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.clearCounterupdaterequest = function() { + return this.setCounterupdaterequest(undefined); }; @@ -1457,48 +1729,11 @@ proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.clearCounter = functio * Returns whether this field is set. * @return {boolean} */ -proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.hasCounter = function() { +proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.hasCounterupdaterequest = function() { return jspb.Message.getField(this, 1) != null; }; -/** - * optional google.protobuf.FieldMask update_mask = 2; - * @return {?proto.google.protobuf.FieldMask} - */ -proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.getUpdateMask = function() { - return /** @type{?proto.google.protobuf.FieldMask} */ ( - jspb.Message.getWrapperField(this, google_protobuf_field_mask_pb.FieldMask, 2)); -}; - - -/** - * @param {?proto.google.protobuf.FieldMask|undefined} value - * @return {!proto.agones.dev.sdk.alpha.UpdateCounterRequest} returns this -*/ -proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.setUpdateMask = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.agones.dev.sdk.alpha.UpdateCounterRequest} returns this - */ -proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.clearUpdateMask = function() { - return this.setUpdateMask(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.agones.dev.sdk.alpha.UpdateCounterRequest.prototype.hasUpdateMask = function() { - return jspb.Message.getField(this, 2) != null; -}; - - /** * List of repeated fields within this message type. diff --git a/sdks/rust/proto/sdk/alpha/alpha.proto b/sdks/rust/proto/sdk/alpha/alpha.proto index aeb9007cbd..00bf3ffff6 100644 --- a/sdks/rust/proto/sdk/alpha/alpha.proto +++ b/sdks/rust/proto/sdk/alpha/alpha.proto @@ -23,6 +23,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; +import "google/protobuf/wrappers.proto"; import "protoc-gen-openapiv2/options/annotations.proto"; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { @@ -138,15 +139,12 @@ service SDK { // UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated). // Returns OUT_OF_RANGE if the Count is out of range [0,Capacity]. - // Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the Counter. - // If a field mask path(s) is specified, but the value is not set in the request Counter object, - // then the default value for the variable will be set (i.e. 0 for "capacity" or "count"). rpc UpdateCounter(UpdateCounterRequest) returns (Counter) { option (google.api.http) = { - patch: "/v1alpha1/{counter.name=counters/*}" - body: "counter" + patch: "/v1alpha1/{counterUpdateRequest.name=counterUpdateRequests/*}" + body: "counterUpdateRequest" }; - option (google.api.method_signature) = "counter,update_mask"; + option (google.api.method_signature) = "counterUpdateRequest"; } // Gets a List. Returns NOT_FOUND if the List does not exist. @@ -229,6 +227,23 @@ message Counter { int64 capacity = 3; } +// A representation of a Counter Update Request. +message CounterUpdateRequest { + option (google.api.resource) = { + type: "agones.dev/CounterUpdateRequest" + pattern: "counterUpdateRequests/{counterUpdateRequest}" + }; + // The name of the Counter to update + string name = 1; + // The value to set the Counter Count + google.protobuf.Int64Value count = 2; + // The value to set the Counter Capacity + google.protobuf.Int64Value capacity = 3; + // countDiff tracks if a Counter Update Request is CountIncrement (positive), CountDecrement + // (negative), 0 if a CountSet or CapacitySet request + int64 countDiff = 4; +} + message GetCounterRequest { // The name of the Counter to get string name = 1 [ @@ -239,17 +254,12 @@ message GetCounterRequest { } message UpdateCounterRequest { - // The Counter to update - Counter counter = 1 [ + // The requested update to make to the Counter + CounterUpdateRequest counterUpdateRequest = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "agones.dev/Counter" + type: "agones.dev/CounterUpdateRequest" }]; - - // Required. Mask (list) of fields to update. - // Fields are specified relative to the Counter - // (e.g. `count`, `capacity`; *not* `Counter.count` or `Counter.capacity`). - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } // A representation of a List. diff --git a/sdks/swagger/alpha.swagger.json b/sdks/swagger/alpha.swagger.json index 1f6a0c1b2a..1ae8e4b4bf 100644 --- a/sdks/swagger/alpha.swagger.json +++ b/sdks/swagger/alpha.swagger.json @@ -183,9 +183,9 @@ ] } }, - "/v1alpha1/{counter.name}": { + "/v1alpha1/{counterUpdateRequest.name}": { "patch": { - "summary": "UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated).\nReturns OUT_OF_RANGE if the Count is out of range [0,Capacity].\nReturns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the Counter.\nIf a field mask path(s) is specified, but the value is not set in the request Counter object,\nthen the default value for the variable will be set (i.e. 0 for \"capacity\" or \"count\").", + "summary": "UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated).\nReturns OUT_OF_RANGE if the Count is out of range [0,Capacity].", "operationId": "UpdateCounter", "responses": { "200": { @@ -197,16 +197,16 @@ }, "parameters": [ { - "name": "counter.name", - "description": "The name of the Counter", + "name": "counterUpdateRequest.name", + "description": "The name of the Counter to update", "in": "path", "required": true, "type": "string", - "pattern": "counters/[^/]+" + "pattern": "counterUpdateRequests/[^/]+" }, { - "name": "counter", - "description": "The Counter to update", + "name": "counterUpdateRequest", + "description": "The requested update to make to the Counter", "in": "body", "required": true, "schema": { @@ -215,15 +215,20 @@ "count": { "type": "string", "format": "int64", - "title": "The current count of the Counter" + "title": "The value to set the Counter Count" }, "capacity": { "type": "string", "format": "int64", - "title": "The maximum capacity of the Counter" + "title": "The value to set the Counter Capacity" + }, + "countDiff": { + "type": "string", + "format": "int64", + "title": "countDiff tracks if a Counter Update Request is CountIncrement (positive), CountDecrement\n(negative), 0 if a CountSet or CapacitySet request" } }, - "title": "The Counter to update" + "title": "The requested update to make to the Counter" } } ], @@ -465,6 +470,31 @@ }, "description": "A representation of a Counter." }, + "alphaCounterUpdateRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "The name of the Counter to update" + }, + "count": { + "type": "string", + "format": "int64", + "title": "The value to set the Counter Count" + }, + "capacity": { + "type": "string", + "format": "int64", + "title": "The value to set the Counter Capacity" + }, + "countDiff": { + "type": "string", + "format": "int64", + "title": "countDiff tracks if a Counter Update Request is CountIncrement (positive), CountDecrement\n(negative), 0 if a CountSet or CapacitySet request" + } + }, + "description": "A representation of a Counter Update Request." + }, "alphaList": { "type": "object", "properties": { diff --git a/test/e2e/gameserver_test.go b/test/e2e/gameserver_test.go index 2664cb6fc6..b38f3685df 100644 --- a/test/e2e/gameserver_test.go +++ b/test/e2e/gameserver_test.go @@ -925,6 +925,7 @@ func TestGameServerWithoutPort(t *testing.T) { func TestGameServerResourceValidation(t *testing.T) { t.Parallel() ctx := context.Background() + logger := e2eframework.TestLogger(t) gs := framework.DefaultGameServer(framework.Namespace) mi64 := resource.MustParse("64Mi") gs.Spec.Template.Spec.Containers[0].Resources.Limits[corev1.ResourceMemory] = mi64 @@ -948,6 +949,7 @@ func TestGameServerResourceValidation(t *testing.T) { assert.NotNil(t, err) statusErr, ok = err.(*k8serrors.StatusError) assert.True(t, ok) + logger.Debug("TestGameServerResourceValidation gsClient.Create with negative resource status errors: ", statusErr) assert.Len(t, statusErr.Status().Details.Causes, 2) assert.Equal(t, metav1.CauseTypeFieldValueInvalid, statusErr.Status().Details.Causes[0].Type) assert.Equal(t, "spec.template.spec.containers[0].resources.requests[cpu]", statusErr.Status().Details.Causes[0].Field) diff --git a/test/sdk/restapi/alpha/swagger/api_sdk.go b/test/sdk/restapi/alpha/swagger/api_sdk.go index d318b846f5..00bc5c4762 100644 --- a/test/sdk/restapi/alpha/swagger/api_sdk.go +++ b/test/sdk/restapi/alpha/swagger/api_sdk.go @@ -973,13 +973,13 @@ func (a *SDKApiService) SetPlayerCapacity(ctx context.Context, body AlphaCount) return localVarReturnValue, localVarHttpResponse, nil } /* -SDKApiService UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated). Returns OUT_OF_RANGE if the Count is out of range [0,Capacity]. Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the Counter. If a field mask path(s) is specified, but the value is not set in the request Counter object, then the default value for the variable will be set (i.e. 0 for \"capacity\" or \"count\"). +SDKApiService UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated). Returns OUT_OF_RANGE if the Count is out of range [0,Capacity]. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body The Counter to update - * @param counterName The name of the Counter + * @param body The requested update to make to the Counter + * @param counterUpdateRequestName The name of the Counter to update @return AlphaCounter */ -func (a *SDKApiService) UpdateCounter(ctx context.Context, body TheCounterToUpdate, counterName string) (AlphaCounter, *http.Response, error) { +func (a *SDKApiService) UpdateCounter(ctx context.Context, body TheRequestedUpdateToMakeToTheCounter, counterUpdateRequestName string) (AlphaCounter, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} @@ -989,8 +989,8 @@ func (a *SDKApiService) UpdateCounter(ctx context.Context, body TheCounterToUpda ) // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v1alpha1/{counter.name}" - localVarPath = strings.Replace(localVarPath, "{"+"counter.name"+"}", fmt.Sprintf("%v", counterName), -1) + localVarPath := a.client.cfg.BasePath + "/v1alpha1/{counterUpdateRequest.name}" + localVarPath = strings.Replace(localVarPath, "{"+"counterUpdateRequest.name"+"}", fmt.Sprintf("%v", counterUpdateRequestName), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/test/sdk/restapi/alpha/swagger/model_alpha_counter_update_request.go b/test/sdk/restapi/alpha/swagger/model_alpha_counter_update_request.go new file mode 100644 index 0000000000..c7127e16b1 --- /dev/null +++ b/test/sdk/restapi/alpha/swagger/model_alpha_counter_update_request.go @@ -0,0 +1,32 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. +/* + * alpha.proto + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: version not set + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package swagger + +// A representation of a Counter Update Request. +type AlphaCounterUpdateRequest struct { + Name string `json:"name,omitempty"` + Count string `json:"count,omitempty"` + Capacity string `json:"capacity,omitempty"` + CountDiff string `json:"countDiff,omitempty"` +} diff --git a/test/sdk/restapi/alpha/swagger/model_the_counter_to_update.go b/test/sdk/restapi/alpha/swagger/model_the_requested_update_to_make_to_the_counter.go similarity index 91% rename from test/sdk/restapi/alpha/swagger/model_the_counter_to_update.go rename to test/sdk/restapi/alpha/swagger/model_the_requested_update_to_make_to_the_counter.go index e8bb3ce94d..c082bf1df1 100644 --- a/test/sdk/restapi/alpha/swagger/model_the_counter_to_update.go +++ b/test/sdk/restapi/alpha/swagger/model_the_requested_update_to_make_to_the_counter.go @@ -23,7 +23,8 @@ */ package swagger -type TheCounterToUpdate struct { +type TheRequestedUpdateToMakeToTheCounter struct { Count string `json:"count,omitempty"` Capacity string `json:"capacity,omitempty"` + CountDiff string `json:"countDiff,omitempty"` }