From 94e367f47359a659923994a88a92e175c8b2202a Mon Sep 17 00:00:00 2001 From: Markus Reinhold Date: Sat, 29 Nov 2025 21:37:03 +0100 Subject: [PATCH 1/5] Add bot messages --- go/identity/v1/messaging.pb.go | 265 +++++++++++++++++- .../Api/GPBMetadata/Identity/V1/Messaging.php | 15 +- php/GamingPlatform/Api/Identity/V1/Bot.php | 85 ++++++ .../Api/Identity/V1/GetBotByUsername.php | 58 ++++ .../Identity/V1/GetBotByUsernameResponse.php | 68 +++++ .../Api/Identity/V1/IdentityV1Factory.php | 50 ++++ .../Api/Identity/V1/RegisterBot.php | 58 ++++ .../Api/Identity/V1/RegisterBotResponse.php | 58 ++++ .../api/identity/v1/messaging.proto | 21 ++ 9 files changed, 666 insertions(+), 12 deletions(-) create mode 100644 php/GamingPlatform/Api/Identity/V1/Bot.php create mode 100644 php/GamingPlatform/Api/Identity/V1/GetBotByUsername.php create mode 100644 php/GamingPlatform/Api/Identity/V1/GetBotByUsernameResponse.php create mode 100644 php/GamingPlatform/Api/Identity/V1/RegisterBot.php create mode 100644 php/GamingPlatform/Api/Identity/V1/RegisterBotResponse.php diff --git a/go/identity/v1/messaging.pb.go b/go/identity/v1/messaging.pb.go index 69061b6..01ec9ac 100644 --- a/go/identity/v1/messaging.pb.go +++ b/go/identity/v1/messaging.pb.go @@ -125,6 +125,234 @@ func (x *UserSignedUp) GetEmail() string { return "" } +type RegisterBot struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RegisterBot) Reset() { + *x = RegisterBot{} + mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RegisterBot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterBot) ProtoMessage() {} + +func (x *RegisterBot) ProtoReflect() protoreflect.Message { + mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterBot.ProtoReflect.Descriptor instead. +func (*RegisterBot) Descriptor() ([]byte, []int) { + return file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP(), []int{2} +} + +func (x *RegisterBot) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type RegisterBotResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + BotId string `protobuf:"bytes,1,opt,name=bot_id,json=botId,proto3" json:"bot_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RegisterBotResponse) Reset() { + *x = RegisterBotResponse{} + mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RegisterBotResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterBotResponse) ProtoMessage() {} + +func (x *RegisterBotResponse) ProtoReflect() protoreflect.Message { + mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterBotResponse.ProtoReflect.Descriptor instead. +func (*RegisterBotResponse) Descriptor() ([]byte, []int) { + return file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP(), []int{3} +} + +func (x *RegisterBotResponse) GetBotId() string { + if x != nil { + return x.BotId + } + return "" +} + +type GetBotByUsername struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetBotByUsername) Reset() { + *x = GetBotByUsername{} + mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBotByUsername) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBotByUsername) ProtoMessage() {} + +func (x *GetBotByUsername) ProtoReflect() protoreflect.Message { + mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBotByUsername.ProtoReflect.Descriptor instead. +func (*GetBotByUsername) Descriptor() ([]byte, []int) { + return file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP(), []int{4} +} + +func (x *GetBotByUsername) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type GetBotByUsernameResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Bot *Bot `protobuf:"bytes,1,opt,name=bot,proto3" json:"bot,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetBotByUsernameResponse) Reset() { + *x = GetBotByUsernameResponse{} + mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBotByUsernameResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBotByUsernameResponse) ProtoMessage() {} + +func (x *GetBotByUsernameResponse) ProtoReflect() protoreflect.Message { + mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBotByUsernameResponse.ProtoReflect.Descriptor instead. +func (*GetBotByUsernameResponse) Descriptor() ([]byte, []int) { + return file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP(), []int{5} +} + +func (x *GetBotByUsernameResponse) GetBot() *Bot { + if x != nil { + return x.Bot + } + return nil +} + +type Bot struct { + state protoimpl.MessageState `protogen:"open.v1"` + BotId string `protobuf:"bytes,1,opt,name=bot_id,json=botId,proto3" json:"bot_id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Bot) Reset() { + *x = Bot{} + mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Bot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bot) ProtoMessage() {} + +func (x *Bot) ProtoReflect() protoreflect.Message { + mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Bot.ProtoReflect.Descriptor instead. +func (*Bot) Descriptor() ([]byte, []int) { + return file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP(), []int{6} +} + +func (x *Bot) GetBotId() string { + if x != nil { + return x.BotId + } + return "" +} + +func (x *Bot) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + var File_gamingplatform_api_identity_v1_messaging_proto protoreflect.FileDescriptor const file_gamingplatform_api_identity_v1_messaging_proto_rawDesc = "" + @@ -135,7 +363,18 @@ const file_gamingplatform_api_identity_v1_messaging_proto_rawDesc = "" + "\fUserSignedUp\x12\x17\n" + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1a\n" + "\busername\x18\x02 \x01(\tR\busername\x12\x14\n" + - "\x05email\x18\x03 \x01(\tR\x05emailBfZ\x16identity/v1;identityv1\xca\x02\x1eGamingPlatform\\Api\\Identity\\V1\xe2\x02*GamingPlatform\\Api\\GPBMetadata\\Identity\\V1b\x06proto3" + "\x05email\x18\x03 \x01(\tR\x05email\")\n" + + "\vRegisterBot\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\",\n" + + "\x13RegisterBotResponse\x12\x15\n" + + "\x06bot_id\x18\x01 \x01(\tR\x05botId\".\n" + + "\x10GetBotByUsername\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\"Q\n" + + "\x18GetBotByUsernameResponse\x125\n" + + "\x03bot\x18\x01 \x01(\v2#.gamingplatform.api.identity.v1.BotR\x03bot\"8\n" + + "\x03Bot\x12\x15\n" + + "\x06bot_id\x18\x01 \x01(\tR\x05botId\x12\x1a\n" + + "\busername\x18\x02 \x01(\tR\busernameBfZ\x16identity/v1;identityv1\xca\x02\x1eGamingPlatform\\Api\\Identity\\V1\xe2\x02*GamingPlatform\\Api\\GPBMetadata\\Identity\\V1b\x06proto3" var ( file_gamingplatform_api_identity_v1_messaging_proto_rawDescOnce sync.Once @@ -149,17 +388,23 @@ func file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP() []byte { return file_gamingplatform_api_identity_v1_messaging_proto_rawDescData } -var file_gamingplatform_api_identity_v1_messaging_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_gamingplatform_api_identity_v1_messaging_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_gamingplatform_api_identity_v1_messaging_proto_goTypes = []any{ - (*UserArrived)(nil), // 0: gamingplatform.api.identity.v1.UserArrived - (*UserSignedUp)(nil), // 1: gamingplatform.api.identity.v1.UserSignedUp + (*UserArrived)(nil), // 0: gamingplatform.api.identity.v1.UserArrived + (*UserSignedUp)(nil), // 1: gamingplatform.api.identity.v1.UserSignedUp + (*RegisterBot)(nil), // 2: gamingplatform.api.identity.v1.RegisterBot + (*RegisterBotResponse)(nil), // 3: gamingplatform.api.identity.v1.RegisterBotResponse + (*GetBotByUsername)(nil), // 4: gamingplatform.api.identity.v1.GetBotByUsername + (*GetBotByUsernameResponse)(nil), // 5: gamingplatform.api.identity.v1.GetBotByUsernameResponse + (*Bot)(nil), // 6: gamingplatform.api.identity.v1.Bot } var file_gamingplatform_api_identity_v1_messaging_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 6, // 0: gamingplatform.api.identity.v1.GetBotByUsernameResponse.bot:type_name -> gamingplatform.api.identity.v1.Bot + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_gamingplatform_api_identity_v1_messaging_proto_init() } @@ -173,7 +418,7 @@ func file_gamingplatform_api_identity_v1_messaging_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_gamingplatform_api_identity_v1_messaging_proto_rawDesc), len(file_gamingplatform_api_identity_v1_messaging_proto_rawDesc)), NumEnums: 0, - NumMessages: 2, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/php/GamingPlatform/Api/GPBMetadata/Identity/V1/Messaging.php b/php/GamingPlatform/Api/GPBMetadata/Identity/V1/Messaging.php index fc9b00f..ae15eeb 100644 --- a/php/GamingPlatform/Api/GPBMetadata/Identity/V1/Messaging.php +++ b/php/GamingPlatform/Api/GPBMetadata/Identity/V1/Messaging.php @@ -16,14 +16,25 @@ public static function initOnce() { } $pool->internalAddGeneratedFile( ' -¢ +‡ .gamingplatform/api/identity/v1/messaging.protogamingplatform.api.identity.v1" UserArrived user_id ( "@ UserSignedUp user_id (  username (  -email ( BfZidentity/v1;identityv1ÊGamingPlatform\\Api\\Identity\\V1â*GamingPlatform\\Api\\GPBMetadata\\Identity\\V1bproto3' +email ( " + RegisterBot +username ( "% +RegisterBotResponse +bot_id ( "$ +GetBotByUsername +username ( "L +GetBotByUsernameResponse0 +bot ( 2#.gamingplatform.api.identity.v1.Bot"\' +Bot +bot_id (  +username ( BfZidentity/v1;identityv1ÊGamingPlatform\\Api\\Identity\\V1â*GamingPlatform\\Api\\GPBMetadata\\Identity\\V1bproto3' , true); static::$is_initialized = true; diff --git a/php/GamingPlatform/Api/Identity/V1/Bot.php b/php/GamingPlatform/Api/Identity/V1/Bot.php new file mode 100644 index 0000000..a09c3cd --- /dev/null +++ b/php/GamingPlatform/Api/Identity/V1/Bot.php @@ -0,0 +1,85 @@ +gamingplatform.api.identity.v1.Bot + */ +class Bot extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string bot_id = 1; + */ + protected $bot_id = ''; + /** + * Generated from protobuf field string username = 2; + */ + protected $username = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bot_id + * @type string $username + * } + */ + public function __construct($data = NULL) { + \GamingPlatform\Api\GPBMetadata\Identity\V1\Messaging::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string bot_id = 1; + * @return string + */ + public function getBotId() + { + return $this->bot_id; + } + + /** + * Generated from protobuf field string bot_id = 1; + * @param string $var + * @return $this + */ + public function setBotId($var) + { + GPBUtil::checkString($var, True); + $this->bot_id = $var; + + return $this; + } + + /** + * Generated from protobuf field string username = 2; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Generated from protobuf field string username = 2; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + +} + diff --git a/php/GamingPlatform/Api/Identity/V1/GetBotByUsername.php b/php/GamingPlatform/Api/Identity/V1/GetBotByUsername.php new file mode 100644 index 0000000..0e1aa40 --- /dev/null +++ b/php/GamingPlatform/Api/Identity/V1/GetBotByUsername.php @@ -0,0 +1,58 @@ +gamingplatform.api.identity.v1.GetBotByUsername + */ +class GetBotByUsername extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string username = 1; + */ + protected $username = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $username + * } + */ + public function __construct($data = NULL) { + \GamingPlatform\Api\GPBMetadata\Identity\V1\Messaging::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string username = 1; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Generated from protobuf field string username = 1; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + +} + diff --git a/php/GamingPlatform/Api/Identity/V1/GetBotByUsernameResponse.php b/php/GamingPlatform/Api/Identity/V1/GetBotByUsernameResponse.php new file mode 100644 index 0000000..f799e6d --- /dev/null +++ b/php/GamingPlatform/Api/Identity/V1/GetBotByUsernameResponse.php @@ -0,0 +1,68 @@ +gamingplatform.api.identity.v1.GetBotByUsernameResponse + */ +class GetBotByUsernameResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .gamingplatform.api.identity.v1.Bot bot = 1; + */ + protected $bot = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \GamingPlatform\Api\Identity\V1\Bot $bot + * } + */ + public function __construct($data = NULL) { + \GamingPlatform\Api\GPBMetadata\Identity\V1\Messaging::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .gamingplatform.api.identity.v1.Bot bot = 1; + * @return \GamingPlatform\Api\Identity\V1\Bot|null + */ + public function getBot() + { + return $this->bot; + } + + public function hasBot() + { + return isset($this->bot); + } + + public function clearBot() + { + unset($this->bot); + } + + /** + * Generated from protobuf field .gamingplatform.api.identity.v1.Bot bot = 1; + * @param \GamingPlatform\Api\Identity\V1\Bot $var + * @return $this + */ + public function setBot($var) + { + GPBUtil::checkMessage($var, \GamingPlatform\Api\Identity\V1\Bot::class); + $this->bot = $var; + + return $this; + } + +} + diff --git a/php/GamingPlatform/Api/Identity/V1/IdentityV1Factory.php b/php/GamingPlatform/Api/Identity/V1/IdentityV1Factory.php index b434505..b164f73 100644 --- a/php/GamingPlatform/Api/Identity/V1/IdentityV1Factory.php +++ b/php/GamingPlatform/Api/Identity/V1/IdentityV1Factory.php @@ -8,6 +8,56 @@ final class IdentityV1Factory { + public static function createBot( + string $data + ): \GamingPlatform\Api\Identity\V1\Bot { + static $template; + $template ??= new \GamingPlatform\Api\Identity\V1\Bot(); + $message = clone $template; + $message->mergeFromString($data); + return $message; + } + + public static function createGetBotByUsername( + string $data + ): \GamingPlatform\Api\Identity\V1\GetBotByUsername { + static $template; + $template ??= new \GamingPlatform\Api\Identity\V1\GetBotByUsername(); + $message = clone $template; + $message->mergeFromString($data); + return $message; + } + + public static function createGetBotByUsernameResponse( + string $data + ): \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse { + static $template; + $template ??= new \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse(); + $message = clone $template; + $message->mergeFromString($data); + return $message; + } + + public static function createRegisterBot( + string $data + ): \GamingPlatform\Api\Identity\V1\RegisterBot { + static $template; + $template ??= new \GamingPlatform\Api\Identity\V1\RegisterBot(); + $message = clone $template; + $message->mergeFromString($data); + return $message; + } + + public static function createRegisterBotResponse( + string $data + ): \GamingPlatform\Api\Identity\V1\RegisterBotResponse { + static $template; + $template ??= new \GamingPlatform\Api\Identity\V1\RegisterBotResponse(); + $message = clone $template; + $message->mergeFromString($data); + return $message; + } + public static function createUserArrived( string $data ): \GamingPlatform\Api\Identity\V1\UserArrived { diff --git a/php/GamingPlatform/Api/Identity/V1/RegisterBot.php b/php/GamingPlatform/Api/Identity/V1/RegisterBot.php new file mode 100644 index 0000000..f142ba8 --- /dev/null +++ b/php/GamingPlatform/Api/Identity/V1/RegisterBot.php @@ -0,0 +1,58 @@ +gamingplatform.api.identity.v1.RegisterBot + */ +class RegisterBot extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string username = 1; + */ + protected $username = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $username + * } + */ + public function __construct($data = NULL) { + \GamingPlatform\Api\GPBMetadata\Identity\V1\Messaging::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string username = 1; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Generated from protobuf field string username = 1; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + +} + diff --git a/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse.php b/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse.php new file mode 100644 index 0000000..47938eb --- /dev/null +++ b/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse.php @@ -0,0 +1,58 @@ +gamingplatform.api.identity.v1.RegisterBotResponse + */ +class RegisterBotResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string bot_id = 1; + */ + protected $bot_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bot_id + * } + */ + public function __construct($data = NULL) { + \GamingPlatform\Api\GPBMetadata\Identity\V1\Messaging::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string bot_id = 1; + * @return string + */ + public function getBotId() + { + return $this->bot_id; + } + + /** + * Generated from protobuf field string bot_id = 1; + * @param string $var + * @return $this + */ + public function setBotId($var) + { + GPBUtil::checkString($var, True); + $this->bot_id = $var; + + return $this; + } + +} + diff --git a/schema/gamingplatform/api/identity/v1/messaging.proto b/schema/gamingplatform/api/identity/v1/messaging.proto index a19c2bc..353a66d 100644 --- a/schema/gamingplatform/api/identity/v1/messaging.proto +++ b/schema/gamingplatform/api/identity/v1/messaging.proto @@ -15,3 +15,24 @@ message UserSignedUp { string username = 2; string email = 3; } + +message RegisterBot { + string username = 1; +} + +message RegisterBotResponse { + string bot_id = 1; +} + +message GetBotByUsername { + string username = 1; +} + +message GetBotByUsernameResponse { + Bot bot = 1; +} + +message Bot { + string bot_id = 1; + string username = 2; +} From b789c50a0039ada72dbf4f482e0d84c229c89992 Mon Sep 17 00:00:00 2001 From: Markus Reinhold Date: Sun, 30 Nov 2025 21:31:28 +0100 Subject: [PATCH 2/5] Distinguish between success and error --- bin/fixGoPaths | 6 + bin/generatePhpFactories | 3 +- go/chat/v1/messaging.pb.go | 2 +- go/common/v1/messaging.pb.go | 333 ++++++++++++++++++ go/identity/v1/messaging.pb.go | 252 +++++++++++-- .../Api/Common/V1/CommonV1Factory.php | 41 +++ php/GamingPlatform/Api/Common/V1/Error.php | 58 +++ .../Api/Common/V1/Error/Violation.php | 115 ++++++ .../Common/V1/Error/Violation/Parameter.php | 182 ++++++++++ .../Api/GPBMetadata/Chat/V1/Messaging.php | 4 +- .../Api/GPBMetadata/Common/V1/Messaging.php | Bin 0 -> 1115 bytes .../Api/GPBMetadata/Identity/V1/Messaging.php | Bin 1087 -> 1512 bytes .../Identity/V1/GetBotByUsernameResponse.php | 64 +++- .../V1/GetBotByUsernameResponse/Success.php | 71 ++++ .../Api/Identity/V1/IdentityV1Factory.php | 20 ++ .../Api/Identity/V1/RegisterBotResponse.php | 66 +++- .../V1/RegisterBotResponse/Success.php | 61 ++++ project | 1 + .../api/chat/v1/messaging.proto | 2 +- .../api/common/v1/messaging.proto | 20 ++ .../api/identity/v1/messaging.proto | 10 +- 21 files changed, 1239 insertions(+), 72 deletions(-) create mode 100755 bin/fixGoPaths create mode 100644 go/common/v1/messaging.pb.go create mode 100644 php/GamingPlatform/Api/Common/V1/CommonV1Factory.php create mode 100644 php/GamingPlatform/Api/Common/V1/Error.php create mode 100644 php/GamingPlatform/Api/Common/V1/Error/Violation.php create mode 100644 php/GamingPlatform/Api/Common/V1/Error/Violation/Parameter.php create mode 100644 php/GamingPlatform/Api/GPBMetadata/Common/V1/Messaging.php create mode 100644 php/GamingPlatform/Api/Identity/V1/GetBotByUsernameResponse/Success.php create mode 100644 php/GamingPlatform/Api/Identity/V1/RegisterBotResponse/Success.php create mode 100644 schema/gamingplatform/api/common/v1/messaging.proto diff --git a/bin/fixGoPaths b/bin/fixGoPaths new file mode 100755 index 0000000..ac9195b --- /dev/null +++ b/bin/fixGoPaths @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -e + +cp -r ./go/github.com/gaming-platform/api/go/* ./go +rm -rf ./go/github.com diff --git a/bin/generatePhpFactories b/bin/generatePhpFactories index 232abda..4217342 100755 --- a/bin/generatePhpFactories +++ b/bin/generatePhpFactories @@ -37,6 +37,7 @@ function generateFactories(string $packageNamespace, string $packagePath, array $factoryName = str_replace('\\', '', $matches['namespace']) . $matches['version'] . 'Factory'; $factoryPath = str_replace('\\', '/', $matches['namespace']) . '/' . $matches['version']; + $methodName = 'create' . str_replace('\\', '_', $matches['message']); $factories[$factoryName] ??= [ 'path' => $packagePath . '/' . $factoryPath . '/' . $factoryName . '.php', @@ -46,7 +47,7 @@ function generateFactories(string $packageNamespace, string $packagePath, array ]; $factories[$factoryName]['methods'][] = [ - 'name' => 'create' . $matches['message'], + 'name' => $methodName, 'returnType' => '\\' . $class ]; } diff --git a/go/chat/v1/messaging.pb.go b/go/chat/v1/messaging.pb.go index ba20c1d..9d102a2 100644 --- a/go/chat/v1/messaging.pb.go +++ b/go/chat/v1/messaging.pb.go @@ -229,7 +229,7 @@ const file_gamingplatform_api_chat_v1_messaging_proto_rawDesc = "" + "\tauthor_id\x18\x03 \x01(\tR\bauthorId\x12\x1d\n" + "\n" + "written_at\x18\x04 \x01(\tR\twrittenAt\x12\x18\n" + - "\amessage\x18\x05 \x01(\tR\amessageBVZ\x0echat/v1;chatv1\xca\x02\x1aGamingPlatform\\Api\\Chat\\V1\xe2\x02&GamingPlatform\\Api\\GPBMetadata\\Chat\\V1b\x06proto3" + "\amessage\x18\x05 \x01(\tR\amessageBxZ0github.com/gaming-platform/api/go/chat/v1;chatv1\xca\x02\x1aGamingPlatform\\Api\\Chat\\V1\xe2\x02&GamingPlatform\\Api\\GPBMetadata\\Chat\\V1b\x06proto3" var ( file_gamingplatform_api_chat_v1_messaging_proto_rawDescOnce sync.Once diff --git a/go/common/v1/messaging.pb.go b/go/common/v1/messaging.pb.go new file mode 100644 index 0000000..c211ed7 --- /dev/null +++ b/go/common/v1/messaging.pb.go @@ -0,0 +1,333 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v4.25.1 +// source: gamingplatform/api/common/v1/messaging.proto + +package commonv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Error struct { + state protoimpl.MessageState `protogen:"open.v1"` + Violations []*Error_Violation `protobuf:"bytes,1,rep,name=violations,proto3" json:"violations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Error) Reset() { + *x = Error{} + mi := &file_gamingplatform_api_common_v1_messaging_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Error) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Error) ProtoMessage() {} + +func (x *Error) ProtoReflect() protoreflect.Message { + mi := &file_gamingplatform_api_common_v1_messaging_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Error.ProtoReflect.Descriptor instead. +func (*Error) Descriptor() ([]byte, []int) { + return file_gamingplatform_api_common_v1_messaging_proto_rawDescGZIP(), []int{0} +} + +func (x *Error) GetViolations() []*Error_Violation { + if x != nil { + return x.Violations + } + return nil +} + +type Error_Violation struct { + state protoimpl.MessageState `protogen:"open.v1"` + PropertyPath string `protobuf:"bytes,1,opt,name=property_path,json=propertyPath,proto3" json:"property_path,omitempty"` + Identifier string `protobuf:"bytes,2,opt,name=identifier,proto3" json:"identifier,omitempty"` + Parameters []*Error_Violation_Parameter `protobuf:"bytes,3,rep,name=parameters,proto3" json:"parameters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Error_Violation) Reset() { + *x = Error_Violation{} + mi := &file_gamingplatform_api_common_v1_messaging_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Error_Violation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Error_Violation) ProtoMessage() {} + +func (x *Error_Violation) ProtoReflect() protoreflect.Message { + mi := &file_gamingplatform_api_common_v1_messaging_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Error_Violation.ProtoReflect.Descriptor instead. +func (*Error_Violation) Descriptor() ([]byte, []int) { + return file_gamingplatform_api_common_v1_messaging_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Error_Violation) GetPropertyPath() string { + if x != nil { + return x.PropertyPath + } + return "" +} + +func (x *Error_Violation) GetIdentifier() string { + if x != nil { + return x.Identifier + } + return "" +} + +func (x *Error_Violation) GetParameters() []*Error_Violation_Parameter { + if x != nil { + return x.Parameters + } + return nil +} + +type Error_Violation_Parameter struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Types that are valid to be assigned to Value: + // + // *Error_Violation_Parameter_BoolValue + // *Error_Violation_Parameter_IntValue + // *Error_Violation_Parameter_FloatValue + // *Error_Violation_Parameter_StringValue + Value isError_Violation_Parameter_Value `protobuf_oneof:"value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Error_Violation_Parameter) Reset() { + *x = Error_Violation_Parameter{} + mi := &file_gamingplatform_api_common_v1_messaging_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Error_Violation_Parameter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Error_Violation_Parameter) ProtoMessage() {} + +func (x *Error_Violation_Parameter) ProtoReflect() protoreflect.Message { + mi := &file_gamingplatform_api_common_v1_messaging_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Error_Violation_Parameter.ProtoReflect.Descriptor instead. +func (*Error_Violation_Parameter) Descriptor() ([]byte, []int) { + return file_gamingplatform_api_common_v1_messaging_proto_rawDescGZIP(), []int{0, 0, 0} +} + +func (x *Error_Violation_Parameter) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Error_Violation_Parameter) GetValue() isError_Violation_Parameter_Value { + if x != nil { + return x.Value + } + return nil +} + +func (x *Error_Violation_Parameter) GetBoolValue() bool { + if x != nil { + if x, ok := x.Value.(*Error_Violation_Parameter_BoolValue); ok { + return x.BoolValue + } + } + return false +} + +func (x *Error_Violation_Parameter) GetIntValue() int64 { + if x != nil { + if x, ok := x.Value.(*Error_Violation_Parameter_IntValue); ok { + return x.IntValue + } + } + return 0 +} + +func (x *Error_Violation_Parameter) GetFloatValue() float32 { + if x != nil { + if x, ok := x.Value.(*Error_Violation_Parameter_FloatValue); ok { + return x.FloatValue + } + } + return 0 +} + +func (x *Error_Violation_Parameter) GetStringValue() string { + if x != nil { + if x, ok := x.Value.(*Error_Violation_Parameter_StringValue); ok { + return x.StringValue + } + } + return "" +} + +type isError_Violation_Parameter_Value interface { + isError_Violation_Parameter_Value() +} + +type Error_Violation_Parameter_BoolValue struct { + BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"` +} + +type Error_Violation_Parameter_IntValue struct { + IntValue int64 `protobuf:"varint,3,opt,name=int_value,json=intValue,proto3,oneof"` +} + +type Error_Violation_Parameter_FloatValue struct { + FloatValue float32 `protobuf:"fixed32,4,opt,name=float_value,json=floatValue,proto3,oneof"` +} + +type Error_Violation_Parameter_StringValue struct { + StringValue string `protobuf:"bytes,5,opt,name=string_value,json=stringValue,proto3,oneof"` +} + +func (*Error_Violation_Parameter_BoolValue) isError_Violation_Parameter_Value() {} + +func (*Error_Violation_Parameter_IntValue) isError_Violation_Parameter_Value() {} + +func (*Error_Violation_Parameter_FloatValue) isError_Violation_Parameter_Value() {} + +func (*Error_Violation_Parameter_StringValue) isError_Violation_Parameter_Value() {} + +var File_gamingplatform_api_common_v1_messaging_proto protoreflect.FileDescriptor + +const file_gamingplatform_api_common_v1_messaging_proto_rawDesc = "" + + "\n" + + ",gamingplatform/api/common/v1/messaging.proto\x12\x1cgamingplatform.api.common.v1\"\xb5\x03\n" + + "\x05Error\x12M\n" + + "\n" + + "violations\x18\x01 \x03(\v2-.gamingplatform.api.common.v1.Error.ViolationR\n" + + "violations\x1a\xdc\x02\n" + + "\tViolation\x12#\n" + + "\rproperty_path\x18\x01 \x01(\tR\fpropertyPath\x12\x1e\n" + + "\n" + + "identifier\x18\x02 \x01(\tR\n" + + "identifier\x12W\n" + + "\n" + + "parameters\x18\x03 \x03(\v27.gamingplatform.api.common.v1.Error.Violation.ParameterR\n" + + "parameters\x1a\xb0\x01\n" + + "\tParameter\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x1f\n" + + "\n" + + "bool_value\x18\x02 \x01(\bH\x00R\tboolValue\x12\x1d\n" + + "\tint_value\x18\x03 \x01(\x03H\x00R\bintValue\x12!\n" + + "\vfloat_value\x18\x04 \x01(\x02H\x00R\n" + + "floatValue\x12#\n" + + "\fstring_value\x18\x05 \x01(\tH\x00R\vstringValueB\a\n" + + "\x05valueB\x80\x01Z4github.com/gaming-platform/api/go/common/v1;commonv1\xca\x02\x1cGamingPlatform\\Api\\Common\\V1\xe2\x02(GamingPlatform\\Api\\GPBMetadata\\Common\\V1b\x06proto3" + +var ( + file_gamingplatform_api_common_v1_messaging_proto_rawDescOnce sync.Once + file_gamingplatform_api_common_v1_messaging_proto_rawDescData []byte +) + +func file_gamingplatform_api_common_v1_messaging_proto_rawDescGZIP() []byte { + file_gamingplatform_api_common_v1_messaging_proto_rawDescOnce.Do(func() { + file_gamingplatform_api_common_v1_messaging_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_gamingplatform_api_common_v1_messaging_proto_rawDesc), len(file_gamingplatform_api_common_v1_messaging_proto_rawDesc))) + }) + return file_gamingplatform_api_common_v1_messaging_proto_rawDescData +} + +var file_gamingplatform_api_common_v1_messaging_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_gamingplatform_api_common_v1_messaging_proto_goTypes = []any{ + (*Error)(nil), // 0: gamingplatform.api.common.v1.Error + (*Error_Violation)(nil), // 1: gamingplatform.api.common.v1.Error.Violation + (*Error_Violation_Parameter)(nil), // 2: gamingplatform.api.common.v1.Error.Violation.Parameter +} +var file_gamingplatform_api_common_v1_messaging_proto_depIdxs = []int32{ + 1, // 0: gamingplatform.api.common.v1.Error.violations:type_name -> gamingplatform.api.common.v1.Error.Violation + 2, // 1: gamingplatform.api.common.v1.Error.Violation.parameters:type_name -> gamingplatform.api.common.v1.Error.Violation.Parameter + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_gamingplatform_api_common_v1_messaging_proto_init() } +func file_gamingplatform_api_common_v1_messaging_proto_init() { + if File_gamingplatform_api_common_v1_messaging_proto != nil { + return + } + file_gamingplatform_api_common_v1_messaging_proto_msgTypes[2].OneofWrappers = []any{ + (*Error_Violation_Parameter_BoolValue)(nil), + (*Error_Violation_Parameter_IntValue)(nil), + (*Error_Violation_Parameter_FloatValue)(nil), + (*Error_Violation_Parameter_StringValue)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_gamingplatform_api_common_v1_messaging_proto_rawDesc), len(file_gamingplatform_api_common_v1_messaging_proto_rawDesc)), + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_gamingplatform_api_common_v1_messaging_proto_goTypes, + DependencyIndexes: file_gamingplatform_api_common_v1_messaging_proto_depIdxs, + MessageInfos: file_gamingplatform_api_common_v1_messaging_proto_msgTypes, + }.Build() + File_gamingplatform_api_common_v1_messaging_proto = out.File + file_gamingplatform_api_common_v1_messaging_proto_goTypes = nil + file_gamingplatform_api_common_v1_messaging_proto_depIdxs = nil +} diff --git a/go/identity/v1/messaging.pb.go b/go/identity/v1/messaging.pb.go index 01ec9ac..8fc2cbb 100644 --- a/go/identity/v1/messaging.pb.go +++ b/go/identity/v1/messaging.pb.go @@ -7,6 +7,7 @@ package identityv1 import ( + v1 "github.com/gaming-platform/api/go/common/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -170,8 +171,12 @@ func (x *RegisterBot) GetUsername() string { } type RegisterBotResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - BotId string `protobuf:"bytes,1,opt,name=bot_id,json=botId,proto3" json:"bot_id,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Result: + // + // *RegisterBotResponse_Success_ + // *RegisterBotResponse_Error + Result isRegisterBotResponse_Result `protobuf_oneof:"result"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -206,13 +211,47 @@ func (*RegisterBotResponse) Descriptor() ([]byte, []int) { return file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP(), []int{3} } -func (x *RegisterBotResponse) GetBotId() string { +func (x *RegisterBotResponse) GetResult() isRegisterBotResponse_Result { if x != nil { - return x.BotId + return x.Result } - return "" + return nil } +func (x *RegisterBotResponse) GetSuccess() *RegisterBotResponse_Success { + if x != nil { + if x, ok := x.Result.(*RegisterBotResponse_Success_); ok { + return x.Success + } + } + return nil +} + +func (x *RegisterBotResponse) GetError() *v1.Error { + if x != nil { + if x, ok := x.Result.(*RegisterBotResponse_Error); ok { + return x.Error + } + } + return nil +} + +type isRegisterBotResponse_Result interface { + isRegisterBotResponse_Result() +} + +type RegisterBotResponse_Success_ struct { + Success *RegisterBotResponse_Success `protobuf:"bytes,1,opt,name=success,proto3,oneof"` +} + +type RegisterBotResponse_Error struct { + Error *v1.Error `protobuf:"bytes,2,opt,name=error,proto3,oneof"` +} + +func (*RegisterBotResponse_Success_) isRegisterBotResponse_Result() {} + +func (*RegisterBotResponse_Error) isRegisterBotResponse_Result() {} + type GetBotByUsername struct { state protoimpl.MessageState `protogen:"open.v1"` Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` @@ -258,8 +297,12 @@ func (x *GetBotByUsername) GetUsername() string { } type GetBotByUsernameResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Bot *Bot `protobuf:"bytes,1,opt,name=bot,proto3" json:"bot,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Result: + // + // *GetBotByUsernameResponse_Success_ + // *GetBotByUsernameResponse_Error + Result isGetBotByUsernameResponse_Result `protobuf_oneof:"result"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -294,13 +337,47 @@ func (*GetBotByUsernameResponse) Descriptor() ([]byte, []int) { return file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP(), []int{5} } -func (x *GetBotByUsernameResponse) GetBot() *Bot { +func (x *GetBotByUsernameResponse) GetResult() isGetBotByUsernameResponse_Result { if x != nil { - return x.Bot + return x.Result } return nil } +func (x *GetBotByUsernameResponse) GetSuccess() *GetBotByUsernameResponse_Success { + if x != nil { + if x, ok := x.Result.(*GetBotByUsernameResponse_Success_); ok { + return x.Success + } + } + return nil +} + +func (x *GetBotByUsernameResponse) GetError() *v1.Error { + if x != nil { + if x, ok := x.Result.(*GetBotByUsernameResponse_Error); ok { + return x.Error + } + } + return nil +} + +type isGetBotByUsernameResponse_Result interface { + isGetBotByUsernameResponse_Result() +} + +type GetBotByUsernameResponse_Success_ struct { + Success *GetBotByUsernameResponse_Success `protobuf:"bytes,1,opt,name=success,proto3,oneof"` +} + +type GetBotByUsernameResponse_Error struct { + Error *v1.Error `protobuf:"bytes,2,opt,name=error,proto3,oneof"` +} + +func (*GetBotByUsernameResponse_Success_) isGetBotByUsernameResponse_Result() {} + +func (*GetBotByUsernameResponse_Error) isGetBotByUsernameResponse_Result() {} + type Bot struct { state protoimpl.MessageState `protogen:"open.v1"` BotId string `protobuf:"bytes,1,opt,name=bot_id,json=botId,proto3" json:"bot_id,omitempty"` @@ -353,11 +430,99 @@ func (x *Bot) GetUsername() string { return "" } +type RegisterBotResponse_Success struct { + state protoimpl.MessageState `protogen:"open.v1"` + BotId string `protobuf:"bytes,1,opt,name=bot_id,json=botId,proto3" json:"bot_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RegisterBotResponse_Success) Reset() { + *x = RegisterBotResponse_Success{} + mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RegisterBotResponse_Success) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterBotResponse_Success) ProtoMessage() {} + +func (x *RegisterBotResponse_Success) ProtoReflect() protoreflect.Message { + mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterBotResponse_Success.ProtoReflect.Descriptor instead. +func (*RegisterBotResponse_Success) Descriptor() ([]byte, []int) { + return file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *RegisterBotResponse_Success) GetBotId() string { + if x != nil { + return x.BotId + } + return "" +} + +type GetBotByUsernameResponse_Success struct { + state protoimpl.MessageState `protogen:"open.v1"` + Bot *Bot `protobuf:"bytes,1,opt,name=bot,proto3" json:"bot,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetBotByUsernameResponse_Success) Reset() { + *x = GetBotByUsernameResponse_Success{} + mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBotByUsernameResponse_Success) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBotByUsernameResponse_Success) ProtoMessage() {} + +func (x *GetBotByUsernameResponse_Success) ProtoReflect() protoreflect.Message { + mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBotByUsernameResponse_Success.ProtoReflect.Descriptor instead. +func (*GetBotByUsernameResponse_Success) Descriptor() ([]byte, []int) { + return file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *GetBotByUsernameResponse_Success) GetBot() *Bot { + if x != nil { + return x.Bot + } + return nil +} + var File_gamingplatform_api_identity_v1_messaging_proto protoreflect.FileDescriptor const file_gamingplatform_api_identity_v1_messaging_proto_rawDesc = "" + "\n" + - ".gamingplatform/api/identity/v1/messaging.proto\x12\x1egamingplatform.api.identity.v1\"&\n" + + ".gamingplatform/api/identity/v1/messaging.proto\x12\x1egamingplatform.api.identity.v1\x1a,gamingplatform/api/common/v1/messaging.proto\"&\n" + "\vUserArrived\x12\x17\n" + "\auser_id\x18\x01 \x01(\tR\x06userId\"Y\n" + "\fUserSignedUp\x12\x17\n" + @@ -365,16 +530,24 @@ const file_gamingplatform_api_identity_v1_messaging_proto_rawDesc = "" + "\busername\x18\x02 \x01(\tR\busername\x12\x14\n" + "\x05email\x18\x03 \x01(\tR\x05email\")\n" + "\vRegisterBot\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\",\n" + - "\x13RegisterBotResponse\x12\x15\n" + - "\x06bot_id\x18\x01 \x01(\tR\x05botId\".\n" + + "\busername\x18\x01 \x01(\tR\busername\"\xd7\x01\n" + + "\x13RegisterBotResponse\x12W\n" + + "\asuccess\x18\x01 \x01(\v2;.gamingplatform.api.identity.v1.RegisterBotResponse.SuccessH\x00R\asuccess\x12;\n" + + "\x05error\x18\x02 \x01(\v2#.gamingplatform.api.common.v1.ErrorH\x00R\x05error\x1a \n" + + "\aSuccess\x12\x15\n" + + "\x06bot_id\x18\x01 \x01(\tR\x05botIdB\b\n" + + "\x06result\".\n" + "\x10GetBotByUsername\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\"Q\n" + - "\x18GetBotByUsernameResponse\x125\n" + - "\x03bot\x18\x01 \x01(\v2#.gamingplatform.api.identity.v1.BotR\x03bot\"8\n" + + "\busername\x18\x01 \x01(\tR\busername\"\x81\x02\n" + + "\x18GetBotByUsernameResponse\x12\\\n" + + "\asuccess\x18\x01 \x01(\v2@.gamingplatform.api.identity.v1.GetBotByUsernameResponse.SuccessH\x00R\asuccess\x12;\n" + + "\x05error\x18\x02 \x01(\v2#.gamingplatform.api.common.v1.ErrorH\x00R\x05error\x1a@\n" + + "\aSuccess\x125\n" + + "\x03bot\x18\x01 \x01(\v2#.gamingplatform.api.identity.v1.BotR\x03botB\b\n" + + "\x06result\"8\n" + "\x03Bot\x12\x15\n" + "\x06bot_id\x18\x01 \x01(\tR\x05botId\x12\x1a\n" + - "\busername\x18\x02 \x01(\tR\busernameBfZ\x16identity/v1;identityv1\xca\x02\x1eGamingPlatform\\Api\\Identity\\V1\xe2\x02*GamingPlatform\\Api\\GPBMetadata\\Identity\\V1b\x06proto3" + "\busername\x18\x02 \x01(\tR\busernameB\x88\x01Z8github.com/gaming-platform/api/go/identity/v1;identityv1\xca\x02\x1eGamingPlatform\\Api\\Identity\\V1\xe2\x02*GamingPlatform\\Api\\GPBMetadata\\Identity\\V1b\x06proto3" var ( file_gamingplatform_api_identity_v1_messaging_proto_rawDescOnce sync.Once @@ -388,23 +561,30 @@ func file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP() []byte { return file_gamingplatform_api_identity_v1_messaging_proto_rawDescData } -var file_gamingplatform_api_identity_v1_messaging_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_gamingplatform_api_identity_v1_messaging_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_gamingplatform_api_identity_v1_messaging_proto_goTypes = []any{ - (*UserArrived)(nil), // 0: gamingplatform.api.identity.v1.UserArrived - (*UserSignedUp)(nil), // 1: gamingplatform.api.identity.v1.UserSignedUp - (*RegisterBot)(nil), // 2: gamingplatform.api.identity.v1.RegisterBot - (*RegisterBotResponse)(nil), // 3: gamingplatform.api.identity.v1.RegisterBotResponse - (*GetBotByUsername)(nil), // 4: gamingplatform.api.identity.v1.GetBotByUsername - (*GetBotByUsernameResponse)(nil), // 5: gamingplatform.api.identity.v1.GetBotByUsernameResponse - (*Bot)(nil), // 6: gamingplatform.api.identity.v1.Bot + (*UserArrived)(nil), // 0: gamingplatform.api.identity.v1.UserArrived + (*UserSignedUp)(nil), // 1: gamingplatform.api.identity.v1.UserSignedUp + (*RegisterBot)(nil), // 2: gamingplatform.api.identity.v1.RegisterBot + (*RegisterBotResponse)(nil), // 3: gamingplatform.api.identity.v1.RegisterBotResponse + (*GetBotByUsername)(nil), // 4: gamingplatform.api.identity.v1.GetBotByUsername + (*GetBotByUsernameResponse)(nil), // 5: gamingplatform.api.identity.v1.GetBotByUsernameResponse + (*Bot)(nil), // 6: gamingplatform.api.identity.v1.Bot + (*RegisterBotResponse_Success)(nil), // 7: gamingplatform.api.identity.v1.RegisterBotResponse.Success + (*GetBotByUsernameResponse_Success)(nil), // 8: gamingplatform.api.identity.v1.GetBotByUsernameResponse.Success + (*v1.Error)(nil), // 9: gamingplatform.api.common.v1.Error } var file_gamingplatform_api_identity_v1_messaging_proto_depIdxs = []int32{ - 6, // 0: gamingplatform.api.identity.v1.GetBotByUsernameResponse.bot:type_name -> gamingplatform.api.identity.v1.Bot - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 7, // 0: gamingplatform.api.identity.v1.RegisterBotResponse.success:type_name -> gamingplatform.api.identity.v1.RegisterBotResponse.Success + 9, // 1: gamingplatform.api.identity.v1.RegisterBotResponse.error:type_name -> gamingplatform.api.common.v1.Error + 8, // 2: gamingplatform.api.identity.v1.GetBotByUsernameResponse.success:type_name -> gamingplatform.api.identity.v1.GetBotByUsernameResponse.Success + 9, // 3: gamingplatform.api.identity.v1.GetBotByUsernameResponse.error:type_name -> gamingplatform.api.common.v1.Error + 6, // 4: gamingplatform.api.identity.v1.GetBotByUsernameResponse.Success.bot:type_name -> gamingplatform.api.identity.v1.Bot + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] 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_gamingplatform_api_identity_v1_messaging_proto_init() } @@ -412,13 +592,21 @@ func file_gamingplatform_api_identity_v1_messaging_proto_init() { if File_gamingplatform_api_identity_v1_messaging_proto != nil { return } + file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[3].OneofWrappers = []any{ + (*RegisterBotResponse_Success_)(nil), + (*RegisterBotResponse_Error)(nil), + } + file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[5].OneofWrappers = []any{ + (*GetBotByUsernameResponse_Success_)(nil), + (*GetBotByUsernameResponse_Error)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_gamingplatform_api_identity_v1_messaging_proto_rawDesc), len(file_gamingplatform_api_identity_v1_messaging_proto_rawDesc)), NumEnums: 0, - NumMessages: 7, + NumMessages: 9, NumExtensions: 0, NumServices: 0, }, diff --git a/php/GamingPlatform/Api/Common/V1/CommonV1Factory.php b/php/GamingPlatform/Api/Common/V1/CommonV1Factory.php new file mode 100644 index 0000000..6782ec0 --- /dev/null +++ b/php/GamingPlatform/Api/Common/V1/CommonV1Factory.php @@ -0,0 +1,41 @@ +mergeFromString($data); + return $message; + } + + public static function createError_Violation( + string $data + ): \GamingPlatform\Api\Common\V1\Error\Violation { + static $template; + $template ??= new \GamingPlatform\Api\Common\V1\Error\Violation(); + $message = clone $template; + $message->mergeFromString($data); + return $message; + } + + public static function createError( + string $data + ): \GamingPlatform\Api\Common\V1\Error { + static $template; + $template ??= new \GamingPlatform\Api\Common\V1\Error(); + $message = clone $template; + $message->mergeFromString($data); + return $message; + } + +} diff --git a/php/GamingPlatform/Api/Common/V1/Error.php b/php/GamingPlatform/Api/Common/V1/Error.php new file mode 100644 index 0000000..45a9390 --- /dev/null +++ b/php/GamingPlatform/Api/Common/V1/Error.php @@ -0,0 +1,58 @@ +gamingplatform.api.common.v1.Error + */ +class Error extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .gamingplatform.api.common.v1.Error.Violation violations = 1; + */ + private $violations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\GamingPlatform\Api\Common\V1\Error\Violation>|\Google\Protobuf\Internal\RepeatedField $violations + * } + */ + public function __construct($data = NULL) { + \GamingPlatform\Api\GPBMetadata\Common\V1\Messaging::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .gamingplatform.api.common.v1.Error.Violation violations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getViolations() + { + return $this->violations; + } + + /** + * Generated from protobuf field repeated .gamingplatform.api.common.v1.Error.Violation violations = 1; + * @param array<\GamingPlatform\Api\Common\V1\Error\Violation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setViolations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \GamingPlatform\Api\Common\V1\Error\Violation::class); + $this->violations = $arr; + + return $this; + } + +} + diff --git a/php/GamingPlatform/Api/Common/V1/Error/Violation.php b/php/GamingPlatform/Api/Common/V1/Error/Violation.php new file mode 100644 index 0000000..371916f --- /dev/null +++ b/php/GamingPlatform/Api/Common/V1/Error/Violation.php @@ -0,0 +1,115 @@ +gamingplatform.api.common.v1.Error.Violation + */ +class Violation extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string property_path = 1; + */ + protected $property_path = ''; + /** + * Generated from protobuf field string identifier = 2; + */ + protected $identifier = ''; + /** + * Generated from protobuf field repeated .gamingplatform.api.common.v1.Error.Violation.Parameter parameters = 3; + */ + private $parameters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $property_path + * @type string $identifier + * @type array<\GamingPlatform\Api\Common\V1\Error\Violation\Parameter>|\Google\Protobuf\Internal\RepeatedField $parameters + * } + */ + public function __construct($data = NULL) { + \GamingPlatform\Api\GPBMetadata\Common\V1\Messaging::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string property_path = 1; + * @return string + */ + public function getPropertyPath() + { + return $this->property_path; + } + + /** + * Generated from protobuf field string property_path = 1; + * @param string $var + * @return $this + */ + public function setPropertyPath($var) + { + GPBUtil::checkString($var, True); + $this->property_path = $var; + + return $this; + } + + /** + * Generated from protobuf field string identifier = 2; + * @return string + */ + public function getIdentifier() + { + return $this->identifier; + } + + /** + * Generated from protobuf field string identifier = 2; + * @param string $var + * @return $this + */ + public function setIdentifier($var) + { + GPBUtil::checkString($var, True); + $this->identifier = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .gamingplatform.api.common.v1.Error.Violation.Parameter parameters = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * Generated from protobuf field repeated .gamingplatform.api.common.v1.Error.Violation.Parameter parameters = 3; + * @param array<\GamingPlatform\Api\Common\V1\Error\Violation\Parameter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParameters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \GamingPlatform\Api\Common\V1\Error\Violation\Parameter::class); + $this->parameters = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Violation::class, \GamingPlatform\Api\Common\V1\Error_Violation::class); + diff --git a/php/GamingPlatform/Api/Common/V1/Error/Violation/Parameter.php b/php/GamingPlatform/Api/Common/V1/Error/Violation/Parameter.php new file mode 100644 index 0000000..c565648 --- /dev/null +++ b/php/GamingPlatform/Api/Common/V1/Error/Violation/Parameter.php @@ -0,0 +1,182 @@ +gamingplatform.api.common.v1.Error.Violation.Parameter + */ +class Parameter extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + protected $value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type bool $bool_value + * @type int|string $int_value + * @type float $float_value + * @type string $string_value + * } + */ + public function __construct($data = NULL) { + \GamingPlatform\Api\GPBMetadata\Common\V1\Messaging::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field bool bool_value = 2; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(2); + } + + public function hasBoolValue() + { + return $this->hasOneof(2); + } + + /** + * Generated from protobuf field bool bool_value = 2; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Generated from protobuf field int64 int_value = 3; + * @return int|string + */ + public function getIntValue() + { + return $this->readOneof(3); + } + + public function hasIntValue() + { + return $this->hasOneof(3); + } + + /** + * Generated from protobuf field int64 int_value = 3; + * @param int|string $var + * @return $this + */ + public function setIntValue($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Generated from protobuf field float float_value = 4; + * @return float + */ + public function getFloatValue() + { + return $this->readOneof(4); + } + + public function hasFloatValue() + { + return $this->hasOneof(4); + } + + /** + * Generated from protobuf field float float_value = 4; + * @param float $var + * @return $this + */ + public function setFloatValue($var) + { + GPBUtil::checkFloat($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Generated from protobuf field string string_value = 5; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(5); + } + + public function hasStringValue() + { + return $this->hasOneof(5); + } + + /** + * Generated from protobuf field string string_value = 5; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getValue() + { + return $this->whichOneof("value"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Parameter::class, \GamingPlatform\Api\Common\V1\Error_Violation_Parameter::class); + diff --git a/php/GamingPlatform/Api/GPBMetadata/Chat/V1/Messaging.php b/php/GamingPlatform/Api/GPBMetadata/Chat/V1/Messaging.php index 22d9127..65ea638 100644 --- a/php/GamingPlatform/Api/GPBMetadata/Chat/V1/Messaging.php +++ b/php/GamingPlatform/Api/GPBMetadata/Chat/V1/Messaging.php @@ -16,7 +16,7 @@ public static function initOnce() { } $pool->internalAddGeneratedFile( ' -ª +Ì *gamingplatform/api/chat/v1/messaging.protogamingplatform.api.chat.v1"P InitiateChat idempotency_key (  @@ -32,7 +32,7 @@ public static function initOnce() { author_id (  written_at (  -message ( BVZchat/v1;chatv1ÊGamingPlatform\\Api\\Chat\\V1â&GamingPlatform\\Api\\GPBMetadata\\Chat\\V1bproto3' +message ( BxZ0github.com/gaming-platform/api/go/chat/v1;chatv1ÊGamingPlatform\\Api\\Chat\\V1â&GamingPlatform\\Api\\GPBMetadata\\Chat\\V1bproto3' , true); static::$is_initialized = true; diff --git a/php/GamingPlatform/Api/GPBMetadata/Common/V1/Messaging.php b/php/GamingPlatform/Api/GPBMetadata/Common/V1/Messaging.php new file mode 100644 index 0000000000000000000000000000000000000000..81677fb974e119edfa66d9f0b69418682bb6f554 GIT binary patch literal 1115 zcmb7D!EVz)5N(nM$h2GxMN!qm0+s4YjiUe(QbIrpDQSgDa;SPhmZFWbc2;t{tMxik zfk^N-dTNlts`myeMei$r;>Ndh|KQ6NLAeW7M`DtR4AGZEG2jrxqm zF%9s)V-f>I6ho4FjPwm}xa7GV$=&|2d%-lFP)*&pCWm{~XaRU3jbn1L$_1Z+;3Jc9 z$UPEks_}Km;}MUz<}~D=@IGzg(=cYpzKQjd$kSXzBqa^#Ce3{bjI(4V5ss2RnW!=qkL8;Ub0~!EUS-YJUkYr~RL8b?-viB<+4J ze0&jbJx#{xlT7&W+!to0_#GRbM`1*N8E7MG+JIpvoG zr4|?D=M|^w1w&MNFbJ7&v8EOkBPasR+L&?no~0QDU&+W8^+1J%+kWa=rZZH G-T?p!OlY70 delta 108 zcmaFCy`N*lF2>2sO!_SCEL?gMz4a!iFfCD2.gamingplatform.api.identity.v1.Bot bot = 1; - */ - protected $bot = null; + protected $result; /** * Constructor. @@ -24,7 +21,8 @@ class GetBotByUsernameResponse extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type \GamingPlatform\Api\Identity\V1\Bot $bot + * @type \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse\Success $success + * @type \GamingPlatform\Api\Common\V1\Error $error * } */ public function __construct($data = NULL) { @@ -33,36 +31,66 @@ public function __construct($data = NULL) { } /** - * Generated from protobuf field .gamingplatform.api.identity.v1.Bot bot = 1; - * @return \GamingPlatform\Api\Identity\V1\Bot|null + * Generated from protobuf field .gamingplatform.api.identity.v1.GetBotByUsernameResponse.Success success = 1; + * @return \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse\Success|null + */ + public function getSuccess() + { + return $this->readOneof(1); + } + + public function hasSuccess() + { + return $this->hasOneof(1); + } + + /** + * Generated from protobuf field .gamingplatform.api.identity.v1.GetBotByUsernameResponse.Success success = 1; + * @param \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse\Success $var + * @return $this */ - public function getBot() + public function setSuccess($var) { - return $this->bot; + GPBUtil::checkMessage($var, \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse\Success::class); + $this->writeOneof(1, $var); + + return $this; } - public function hasBot() + /** + * Generated from protobuf field .gamingplatform.api.common.v1.Error error = 2; + * @return \GamingPlatform\Api\Common\V1\Error|null + */ + public function getError() { - return isset($this->bot); + return $this->readOneof(2); } - public function clearBot() + public function hasError() { - unset($this->bot); + return $this->hasOneof(2); } /** - * Generated from protobuf field .gamingplatform.api.identity.v1.Bot bot = 1; - * @param \GamingPlatform\Api\Identity\V1\Bot $var + * Generated from protobuf field .gamingplatform.api.common.v1.Error error = 2; + * @param \GamingPlatform\Api\Common\V1\Error $var * @return $this */ - public function setBot($var) + public function setError($var) { - GPBUtil::checkMessage($var, \GamingPlatform\Api\Identity\V1\Bot::class); - $this->bot = $var; + GPBUtil::checkMessage($var, \GamingPlatform\Api\Common\V1\Error::class); + $this->writeOneof(2, $var); return $this; } + /** + * @return string + */ + public function getResult() + { + return $this->whichOneof("result"); + } + } diff --git a/php/GamingPlatform/Api/Identity/V1/GetBotByUsernameResponse/Success.php b/php/GamingPlatform/Api/Identity/V1/GetBotByUsernameResponse/Success.php new file mode 100644 index 0000000..94a8039 --- /dev/null +++ b/php/GamingPlatform/Api/Identity/V1/GetBotByUsernameResponse/Success.php @@ -0,0 +1,71 @@ +gamingplatform.api.identity.v1.GetBotByUsernameResponse.Success + */ +class Success extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .gamingplatform.api.identity.v1.Bot bot = 1; + */ + protected $bot = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \GamingPlatform\Api\Identity\V1\Bot $bot + * } + */ + public function __construct($data = NULL) { + \GamingPlatform\Api\GPBMetadata\Identity\V1\Messaging::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .gamingplatform.api.identity.v1.Bot bot = 1; + * @return \GamingPlatform\Api\Identity\V1\Bot|null + */ + public function getBot() + { + return $this->bot; + } + + public function hasBot() + { + return isset($this->bot); + } + + public function clearBot() + { + unset($this->bot); + } + + /** + * Generated from protobuf field .gamingplatform.api.identity.v1.Bot bot = 1; + * @param \GamingPlatform\Api\Identity\V1\Bot $var + * @return $this + */ + public function setBot($var) + { + GPBUtil::checkMessage($var, \GamingPlatform\Api\Identity\V1\Bot::class); + $this->bot = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Success::class, \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse_Success::class); + diff --git a/php/GamingPlatform/Api/Identity/V1/IdentityV1Factory.php b/php/GamingPlatform/Api/Identity/V1/IdentityV1Factory.php index b164f73..ae853d6 100644 --- a/php/GamingPlatform/Api/Identity/V1/IdentityV1Factory.php +++ b/php/GamingPlatform/Api/Identity/V1/IdentityV1Factory.php @@ -28,6 +28,16 @@ public static function createGetBotByUsername( return $message; } + public static function createGetBotByUsernameResponse_Success( + string $data + ): \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse\Success { + static $template; + $template ??= new \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse\Success(); + $message = clone $template; + $message->mergeFromString($data); + return $message; + } + public static function createGetBotByUsernameResponse( string $data ): \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse { @@ -48,6 +58,16 @@ public static function createRegisterBot( return $message; } + public static function createRegisterBotResponse_Success( + string $data + ): \GamingPlatform\Api\Identity\V1\RegisterBotResponse\Success { + static $template; + $template ??= new \GamingPlatform\Api\Identity\V1\RegisterBotResponse\Success(); + $message = clone $template; + $message->mergeFromString($data); + return $message; + } + public static function createRegisterBotResponse( string $data ): \GamingPlatform\Api\Identity\V1\RegisterBotResponse { diff --git a/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse.php b/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse.php index 47938eb..7323fd6 100644 --- a/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse.php +++ b/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse.php @@ -13,10 +13,7 @@ */ class RegisterBotResponse extends \Google\Protobuf\Internal\Message { - /** - * Generated from protobuf field string bot_id = 1; - */ - protected $bot_id = ''; + protected $result; /** * Constructor. @@ -24,7 +21,8 @@ class RegisterBotResponse extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type string $bot_id + * @type \GamingPlatform\Api\Identity\V1\RegisterBotResponse\Success $success + * @type \GamingPlatform\Api\Common\V1\Error $error * } */ public function __construct($data = NULL) { @@ -33,26 +31,66 @@ public function __construct($data = NULL) { } /** - * Generated from protobuf field string bot_id = 1; - * @return string + * Generated from protobuf field .gamingplatform.api.identity.v1.RegisterBotResponse.Success success = 1; + * @return \GamingPlatform\Api\Identity\V1\RegisterBotResponse\Success|null + */ + public function getSuccess() + { + return $this->readOneof(1); + } + + public function hasSuccess() + { + return $this->hasOneof(1); + } + + /** + * Generated from protobuf field .gamingplatform.api.identity.v1.RegisterBotResponse.Success success = 1; + * @param \GamingPlatform\Api\Identity\V1\RegisterBotResponse\Success $var + * @return $this + */ + public function setSuccess($var) + { + GPBUtil::checkMessage($var, \GamingPlatform\Api\Identity\V1\RegisterBotResponse\Success::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Generated from protobuf field .gamingplatform.api.common.v1.Error error = 2; + * @return \GamingPlatform\Api\Common\V1\Error|null */ - public function getBotId() + public function getError() + { + return $this->readOneof(2); + } + + public function hasError() { - return $this->bot_id; + return $this->hasOneof(2); } /** - * Generated from protobuf field string bot_id = 1; - * @param string $var + * Generated from protobuf field .gamingplatform.api.common.v1.Error error = 2; + * @param \GamingPlatform\Api\Common\V1\Error $var * @return $this */ - public function setBotId($var) + public function setError($var) { - GPBUtil::checkString($var, True); - $this->bot_id = $var; + GPBUtil::checkMessage($var, \GamingPlatform\Api\Common\V1\Error::class); + $this->writeOneof(2, $var); return $this; } + /** + * @return string + */ + public function getResult() + { + return $this->whichOneof("result"); + } + } diff --git a/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse/Success.php b/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse/Success.php new file mode 100644 index 0000000..9cc31ef --- /dev/null +++ b/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse/Success.php @@ -0,0 +1,61 @@ +gamingplatform.api.identity.v1.RegisterBotResponse.Success + */ +class Success extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string bot_id = 1; + */ + protected $bot_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bot_id + * } + */ + public function __construct($data = NULL) { + \GamingPlatform\Api\GPBMetadata\Identity\V1\Messaging::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string bot_id = 1; + * @return string + */ + public function getBotId() + { + return $this->bot_id; + } + + /** + * Generated from protobuf field string bot_id = 1; + * @param string $var + * @return $this + */ + public function setBotId($var) + { + GPBUtil::checkString($var, True); + $this->bot_id = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Success::class, \GamingPlatform\Api\Identity\V1\RegisterBotResponse_Success::class); + diff --git a/project b/project index 5cc896e..921751d 100755 --- a/project +++ b/project @@ -19,6 +19,7 @@ protoc() { -v $(pwd):/project \ ghcr.io/gaming-platform/docker-php-fpm:8.3-development \ /project/bin/generatePhpFactories + docker compose run --rm protoc /project/bin/fixGoPaths } if [ "$*" = "" ] diff --git a/schema/gamingplatform/api/chat/v1/messaging.proto b/schema/gamingplatform/api/chat/v1/messaging.proto index af129c6..cfd36c4 100644 --- a/schema/gamingplatform/api/chat/v1/messaging.proto +++ b/schema/gamingplatform/api/chat/v1/messaging.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package gamingplatform.api.chat.v1; -option go_package = "chat/v1;chatv1"; +option go_package = "github.com/gaming-platform/api/go/chat/v1;chatv1"; option php_namespace = "GamingPlatform\\Api\\Chat\\V1"; option php_metadata_namespace = "GamingPlatform\\Api\\GPBMetadata\\Chat\\V1"; diff --git a/schema/gamingplatform/api/common/v1/messaging.proto b/schema/gamingplatform/api/common/v1/messaging.proto new file mode 100644 index 0000000..d7ba832 --- /dev/null +++ b/schema/gamingplatform/api/common/v1/messaging.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package gamingplatform.api.common.v1; + +option go_package = "github.com/gaming-platform/api/go/common/v1;commonv1"; +option php_namespace = "GamingPlatform\\Api\\Common\\V1"; +option php_metadata_namespace = "GamingPlatform\\Api\\GPBMetadata\\Common\\V1"; + +message Error { + message Violation { + message Parameter { + string name = 1; + oneof value {bool bool_value = 2; int64 int_value = 3; float float_value = 4; string string_value = 5;} + } + string property_path = 1; + string identifier = 2; + repeated Parameter parameters = 3; + } + repeated Violation violations = 1; +} diff --git a/schema/gamingplatform/api/identity/v1/messaging.proto b/schema/gamingplatform/api/identity/v1/messaging.proto index 353a66d..3148ba5 100644 --- a/schema/gamingplatform/api/identity/v1/messaging.proto +++ b/schema/gamingplatform/api/identity/v1/messaging.proto @@ -2,7 +2,9 @@ syntax = "proto3"; package gamingplatform.api.identity.v1; -option go_package = "identity/v1;identityv1"; +import "gamingplatform/api/common/v1/messaging.proto"; + +option go_package = "github.com/gaming-platform/api/go/identity/v1;identityv1"; option php_namespace = "GamingPlatform\\Api\\Identity\\V1"; option php_metadata_namespace = "GamingPlatform\\Api\\GPBMetadata\\Identity\\V1"; @@ -21,7 +23,8 @@ message RegisterBot { } message RegisterBotResponse { - string bot_id = 1; + message Success {string bot_id = 1;} + oneof result {Success success = 1; gamingplatform.api.common.v1.Error error = 2;} } message GetBotByUsername { @@ -29,7 +32,8 @@ message GetBotByUsername { } message GetBotByUsernameResponse { - Bot bot = 1; + message Success {Bot bot = 1;} + oneof result {Success success = 1; gamingplatform.api.common.v1.Error error = 2;} } message Bot { From f204ccaaa2a6753230916bd8dd66d52d82b80a21 Mon Sep 17 00:00:00 2001 From: Markus Reinhold Date: Mon, 1 Dec 2025 20:43:39 +0100 Subject: [PATCH 3/5] Explain why bin/fixGoPaths exists --- bin/fixGoPaths | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/fixGoPaths b/bin/fixGoPaths index ac9195b..1d741ee 100755 --- a/bin/fixGoPaths +++ b/bin/fixGoPaths @@ -2,5 +2,7 @@ set -e +# Go files are generated into their full module path. +# This script moves the files to the correct location. cp -r ./go/github.com/gaming-platform/api/go/* ./go rm -rf ./go/github.com From af46cb27834e8cac586ddb8a55d5eecedcb6465a Mon Sep 17 00:00:00 2001 From: Markus Reinhold Date: Mon, 1 Dec 2025 21:01:45 +0100 Subject: [PATCH 4/5] Dedicated ErrorResponse --- go/common/v1/messaging.pb.go | 148 +++++------ go/identity/v1/messaging.pb.go | 250 +++--------------- .../Api/Common/V1/CommonV1Factory.php | 18 +- .../V1/{Error.php => ErrorResponse.php} | 16 +- .../V1/{Error => ErrorResponse}/Violation.php | 18 +- .../Violation/Parameter.php | 6 +- .../Api/GPBMetadata/Common/V1/Messaging.php | Bin 1115 -> 1139 bytes .../Api/GPBMetadata/Identity/V1/Messaging.php | Bin 1512 -> 1122 bytes .../Identity/V1/GetBotByUsernameResponse.php | 64 ++--- .../V1/GetBotByUsernameResponse/Success.php | 71 ----- .../Api/Identity/V1/IdentityV1Factory.php | 20 -- .../Api/Identity/V1/RegisterBotResponse.php | 66 +---- .../V1/RegisterBotResponse/Success.php | 61 ----- project | 1 + .../api/common/v1/messaging.proto | 2 +- .../api/identity/v1/messaging.proto | 8 +- 16 files changed, 170 insertions(+), 579 deletions(-) rename php/GamingPlatform/Api/Common/V1/{Error.php => ErrorResponse.php} (70%) rename php/GamingPlatform/Api/Common/V1/{Error => ErrorResponse}/Violation.php (81%) rename php/GamingPlatform/Api/Common/V1/{Error => ErrorResponse}/Violation/Parameter.php (96%) delete mode 100644 php/GamingPlatform/Api/Identity/V1/GetBotByUsernameResponse/Success.php delete mode 100644 php/GamingPlatform/Api/Identity/V1/RegisterBotResponse/Success.php diff --git a/go/common/v1/messaging.pb.go b/go/common/v1/messaging.pb.go index c211ed7..0340d90 100644 --- a/go/common/v1/messaging.pb.go +++ b/go/common/v1/messaging.pb.go @@ -21,27 +21,27 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type Error struct { - state protoimpl.MessageState `protogen:"open.v1"` - Violations []*Error_Violation `protobuf:"bytes,1,rep,name=violations,proto3" json:"violations,omitempty"` +type ErrorResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Violations []*ErrorResponse_Violation `protobuf:"bytes,1,rep,name=violations,proto3" json:"violations,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *Error) Reset() { - *x = Error{} +func (x *ErrorResponse) Reset() { + *x = ErrorResponse{} mi := &file_gamingplatform_api_common_v1_messaging_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Error) String() string { +func (x *ErrorResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Error) ProtoMessage() {} +func (*ErrorResponse) ProtoMessage() {} -func (x *Error) ProtoReflect() protoreflect.Message { +func (x *ErrorResponse) ProtoReflect() protoreflect.Message { mi := &file_gamingplatform_api_common_v1_messaging_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -53,41 +53,41 @@ func (x *Error) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Error.ProtoReflect.Descriptor instead. -func (*Error) Descriptor() ([]byte, []int) { +// Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead. +func (*ErrorResponse) Descriptor() ([]byte, []int) { return file_gamingplatform_api_common_v1_messaging_proto_rawDescGZIP(), []int{0} } -func (x *Error) GetViolations() []*Error_Violation { +func (x *ErrorResponse) GetViolations() []*ErrorResponse_Violation { if x != nil { return x.Violations } return nil } -type Error_Violation struct { - state protoimpl.MessageState `protogen:"open.v1"` - PropertyPath string `protobuf:"bytes,1,opt,name=property_path,json=propertyPath,proto3" json:"property_path,omitempty"` - Identifier string `protobuf:"bytes,2,opt,name=identifier,proto3" json:"identifier,omitempty"` - Parameters []*Error_Violation_Parameter `protobuf:"bytes,3,rep,name=parameters,proto3" json:"parameters,omitempty"` +type ErrorResponse_Violation struct { + state protoimpl.MessageState `protogen:"open.v1"` + PropertyPath string `protobuf:"bytes,1,opt,name=property_path,json=propertyPath,proto3" json:"property_path,omitempty"` + Identifier string `protobuf:"bytes,2,opt,name=identifier,proto3" json:"identifier,omitempty"` + Parameters []*ErrorResponse_Violation_Parameter `protobuf:"bytes,3,rep,name=parameters,proto3" json:"parameters,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *Error_Violation) Reset() { - *x = Error_Violation{} +func (x *ErrorResponse_Violation) Reset() { + *x = ErrorResponse_Violation{} mi := &file_gamingplatform_api_common_v1_messaging_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Error_Violation) String() string { +func (x *ErrorResponse_Violation) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Error_Violation) ProtoMessage() {} +func (*ErrorResponse_Violation) ProtoMessage() {} -func (x *Error_Violation) ProtoReflect() protoreflect.Message { +func (x *ErrorResponse_Violation) ProtoReflect() protoreflect.Message { mi := &file_gamingplatform_api_common_v1_messaging_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -99,60 +99,60 @@ func (x *Error_Violation) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Error_Violation.ProtoReflect.Descriptor instead. -func (*Error_Violation) Descriptor() ([]byte, []int) { +// Deprecated: Use ErrorResponse_Violation.ProtoReflect.Descriptor instead. +func (*ErrorResponse_Violation) Descriptor() ([]byte, []int) { return file_gamingplatform_api_common_v1_messaging_proto_rawDescGZIP(), []int{0, 0} } -func (x *Error_Violation) GetPropertyPath() string { +func (x *ErrorResponse_Violation) GetPropertyPath() string { if x != nil { return x.PropertyPath } return "" } -func (x *Error_Violation) GetIdentifier() string { +func (x *ErrorResponse_Violation) GetIdentifier() string { if x != nil { return x.Identifier } return "" } -func (x *Error_Violation) GetParameters() []*Error_Violation_Parameter { +func (x *ErrorResponse_Violation) GetParameters() []*ErrorResponse_Violation_Parameter { if x != nil { return x.Parameters } return nil } -type Error_Violation_Parameter struct { +type ErrorResponse_Violation_Parameter struct { state protoimpl.MessageState `protogen:"open.v1"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Types that are valid to be assigned to Value: // - // *Error_Violation_Parameter_BoolValue - // *Error_Violation_Parameter_IntValue - // *Error_Violation_Parameter_FloatValue - // *Error_Violation_Parameter_StringValue - Value isError_Violation_Parameter_Value `protobuf_oneof:"value"` + // *ErrorResponse_Violation_Parameter_BoolValue + // *ErrorResponse_Violation_Parameter_IntValue + // *ErrorResponse_Violation_Parameter_FloatValue + // *ErrorResponse_Violation_Parameter_StringValue + Value isErrorResponse_Violation_Parameter_Value `protobuf_oneof:"value"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *Error_Violation_Parameter) Reset() { - *x = Error_Violation_Parameter{} +func (x *ErrorResponse_Violation_Parameter) Reset() { + *x = ErrorResponse_Violation_Parameter{} mi := &file_gamingplatform_api_common_v1_messaging_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Error_Violation_Parameter) String() string { +func (x *ErrorResponse_Violation_Parameter) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Error_Violation_Parameter) ProtoMessage() {} +func (*ErrorResponse_Violation_Parameter) ProtoMessage() {} -func (x *Error_Violation_Parameter) ProtoReflect() protoreflect.Message { +func (x *ErrorResponse_Violation_Parameter) ProtoReflect() protoreflect.Message { mi := &file_gamingplatform_api_common_v1_messaging_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -164,105 +164,105 @@ func (x *Error_Violation_Parameter) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Error_Violation_Parameter.ProtoReflect.Descriptor instead. -func (*Error_Violation_Parameter) Descriptor() ([]byte, []int) { +// Deprecated: Use ErrorResponse_Violation_Parameter.ProtoReflect.Descriptor instead. +func (*ErrorResponse_Violation_Parameter) Descriptor() ([]byte, []int) { return file_gamingplatform_api_common_v1_messaging_proto_rawDescGZIP(), []int{0, 0, 0} } -func (x *Error_Violation_Parameter) GetName() string { +func (x *ErrorResponse_Violation_Parameter) GetName() string { if x != nil { return x.Name } return "" } -func (x *Error_Violation_Parameter) GetValue() isError_Violation_Parameter_Value { +func (x *ErrorResponse_Violation_Parameter) GetValue() isErrorResponse_Violation_Parameter_Value { if x != nil { return x.Value } return nil } -func (x *Error_Violation_Parameter) GetBoolValue() bool { +func (x *ErrorResponse_Violation_Parameter) GetBoolValue() bool { if x != nil { - if x, ok := x.Value.(*Error_Violation_Parameter_BoolValue); ok { + if x, ok := x.Value.(*ErrorResponse_Violation_Parameter_BoolValue); ok { return x.BoolValue } } return false } -func (x *Error_Violation_Parameter) GetIntValue() int64 { +func (x *ErrorResponse_Violation_Parameter) GetIntValue() int64 { if x != nil { - if x, ok := x.Value.(*Error_Violation_Parameter_IntValue); ok { + if x, ok := x.Value.(*ErrorResponse_Violation_Parameter_IntValue); ok { return x.IntValue } } return 0 } -func (x *Error_Violation_Parameter) GetFloatValue() float32 { +func (x *ErrorResponse_Violation_Parameter) GetFloatValue() float32 { if x != nil { - if x, ok := x.Value.(*Error_Violation_Parameter_FloatValue); ok { + if x, ok := x.Value.(*ErrorResponse_Violation_Parameter_FloatValue); ok { return x.FloatValue } } return 0 } -func (x *Error_Violation_Parameter) GetStringValue() string { +func (x *ErrorResponse_Violation_Parameter) GetStringValue() string { if x != nil { - if x, ok := x.Value.(*Error_Violation_Parameter_StringValue); ok { + if x, ok := x.Value.(*ErrorResponse_Violation_Parameter_StringValue); ok { return x.StringValue } } return "" } -type isError_Violation_Parameter_Value interface { - isError_Violation_Parameter_Value() +type isErrorResponse_Violation_Parameter_Value interface { + isErrorResponse_Violation_Parameter_Value() } -type Error_Violation_Parameter_BoolValue struct { +type ErrorResponse_Violation_Parameter_BoolValue struct { BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"` } -type Error_Violation_Parameter_IntValue struct { +type ErrorResponse_Violation_Parameter_IntValue struct { IntValue int64 `protobuf:"varint,3,opt,name=int_value,json=intValue,proto3,oneof"` } -type Error_Violation_Parameter_FloatValue struct { +type ErrorResponse_Violation_Parameter_FloatValue struct { FloatValue float32 `protobuf:"fixed32,4,opt,name=float_value,json=floatValue,proto3,oneof"` } -type Error_Violation_Parameter_StringValue struct { +type ErrorResponse_Violation_Parameter_StringValue struct { StringValue string `protobuf:"bytes,5,opt,name=string_value,json=stringValue,proto3,oneof"` } -func (*Error_Violation_Parameter_BoolValue) isError_Violation_Parameter_Value() {} +func (*ErrorResponse_Violation_Parameter_BoolValue) isErrorResponse_Violation_Parameter_Value() {} -func (*Error_Violation_Parameter_IntValue) isError_Violation_Parameter_Value() {} +func (*ErrorResponse_Violation_Parameter_IntValue) isErrorResponse_Violation_Parameter_Value() {} -func (*Error_Violation_Parameter_FloatValue) isError_Violation_Parameter_Value() {} +func (*ErrorResponse_Violation_Parameter_FloatValue) isErrorResponse_Violation_Parameter_Value() {} -func (*Error_Violation_Parameter_StringValue) isError_Violation_Parameter_Value() {} +func (*ErrorResponse_Violation_Parameter_StringValue) isErrorResponse_Violation_Parameter_Value() {} var File_gamingplatform_api_common_v1_messaging_proto protoreflect.FileDescriptor const file_gamingplatform_api_common_v1_messaging_proto_rawDesc = "" + "\n" + - ",gamingplatform/api/common/v1/messaging.proto\x12\x1cgamingplatform.api.common.v1\"\xb5\x03\n" + - "\x05Error\x12M\n" + + ",gamingplatform/api/common/v1/messaging.proto\x12\x1cgamingplatform.api.common.v1\"\xcd\x03\n" + + "\rErrorResponse\x12U\n" + "\n" + - "violations\x18\x01 \x03(\v2-.gamingplatform.api.common.v1.Error.ViolationR\n" + - "violations\x1a\xdc\x02\n" + + "violations\x18\x01 \x03(\v25.gamingplatform.api.common.v1.ErrorResponse.ViolationR\n" + + "violations\x1a\xe4\x02\n" + "\tViolation\x12#\n" + "\rproperty_path\x18\x01 \x01(\tR\fpropertyPath\x12\x1e\n" + "\n" + "identifier\x18\x02 \x01(\tR\n" + - "identifier\x12W\n" + + "identifier\x12_\n" + "\n" + - "parameters\x18\x03 \x03(\v27.gamingplatform.api.common.v1.Error.Violation.ParameterR\n" + + "parameters\x18\x03 \x03(\v2?.gamingplatform.api.common.v1.ErrorResponse.Violation.ParameterR\n" + "parameters\x1a\xb0\x01\n" + "\tParameter\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x1f\n" + @@ -288,13 +288,13 @@ func file_gamingplatform_api_common_v1_messaging_proto_rawDescGZIP() []byte { var file_gamingplatform_api_common_v1_messaging_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_gamingplatform_api_common_v1_messaging_proto_goTypes = []any{ - (*Error)(nil), // 0: gamingplatform.api.common.v1.Error - (*Error_Violation)(nil), // 1: gamingplatform.api.common.v1.Error.Violation - (*Error_Violation_Parameter)(nil), // 2: gamingplatform.api.common.v1.Error.Violation.Parameter + (*ErrorResponse)(nil), // 0: gamingplatform.api.common.v1.ErrorResponse + (*ErrorResponse_Violation)(nil), // 1: gamingplatform.api.common.v1.ErrorResponse.Violation + (*ErrorResponse_Violation_Parameter)(nil), // 2: gamingplatform.api.common.v1.ErrorResponse.Violation.Parameter } var file_gamingplatform_api_common_v1_messaging_proto_depIdxs = []int32{ - 1, // 0: gamingplatform.api.common.v1.Error.violations:type_name -> gamingplatform.api.common.v1.Error.Violation - 2, // 1: gamingplatform.api.common.v1.Error.Violation.parameters:type_name -> gamingplatform.api.common.v1.Error.Violation.Parameter + 1, // 0: gamingplatform.api.common.v1.ErrorResponse.violations:type_name -> gamingplatform.api.common.v1.ErrorResponse.Violation + 2, // 1: gamingplatform.api.common.v1.ErrorResponse.Violation.parameters:type_name -> gamingplatform.api.common.v1.ErrorResponse.Violation.Parameter 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -308,10 +308,10 @@ func file_gamingplatform_api_common_v1_messaging_proto_init() { return } file_gamingplatform_api_common_v1_messaging_proto_msgTypes[2].OneofWrappers = []any{ - (*Error_Violation_Parameter_BoolValue)(nil), - (*Error_Violation_Parameter_IntValue)(nil), - (*Error_Violation_Parameter_FloatValue)(nil), - (*Error_Violation_Parameter_StringValue)(nil), + (*ErrorResponse_Violation_Parameter_BoolValue)(nil), + (*ErrorResponse_Violation_Parameter_IntValue)(nil), + (*ErrorResponse_Violation_Parameter_FloatValue)(nil), + (*ErrorResponse_Violation_Parameter_StringValue)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/go/identity/v1/messaging.pb.go b/go/identity/v1/messaging.pb.go index 8fc2cbb..0703227 100644 --- a/go/identity/v1/messaging.pb.go +++ b/go/identity/v1/messaging.pb.go @@ -7,7 +7,6 @@ package identityv1 import ( - v1 "github.com/gaming-platform/api/go/common/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -171,12 +170,8 @@ func (x *RegisterBot) GetUsername() string { } type RegisterBotResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Result: - // - // *RegisterBotResponse_Success_ - // *RegisterBotResponse_Error - Result isRegisterBotResponse_Result `protobuf_oneof:"result"` + state protoimpl.MessageState `protogen:"open.v1"` + BotId string `protobuf:"bytes,1,opt,name=bot_id,json=botId,proto3" json:"bot_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -211,47 +206,13 @@ func (*RegisterBotResponse) Descriptor() ([]byte, []int) { return file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP(), []int{3} } -func (x *RegisterBotResponse) GetResult() isRegisterBotResponse_Result { - if x != nil { - return x.Result - } - return nil -} - -func (x *RegisterBotResponse) GetSuccess() *RegisterBotResponse_Success { +func (x *RegisterBotResponse) GetBotId() string { if x != nil { - if x, ok := x.Result.(*RegisterBotResponse_Success_); ok { - return x.Success - } - } - return nil -} - -func (x *RegisterBotResponse) GetError() *v1.Error { - if x != nil { - if x, ok := x.Result.(*RegisterBotResponse_Error); ok { - return x.Error - } + return x.BotId } - return nil -} - -type isRegisterBotResponse_Result interface { - isRegisterBotResponse_Result() -} - -type RegisterBotResponse_Success_ struct { - Success *RegisterBotResponse_Success `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type RegisterBotResponse_Error struct { - Error *v1.Error `protobuf:"bytes,2,opt,name=error,proto3,oneof"` + return "" } -func (*RegisterBotResponse_Success_) isRegisterBotResponse_Result() {} - -func (*RegisterBotResponse_Error) isRegisterBotResponse_Result() {} - type GetBotByUsername struct { state protoimpl.MessageState `protogen:"open.v1"` Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` @@ -297,12 +258,8 @@ func (x *GetBotByUsername) GetUsername() string { } type GetBotByUsernameResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Result: - // - // *GetBotByUsernameResponse_Success_ - // *GetBotByUsernameResponse_Error - Result isGetBotByUsernameResponse_Result `protobuf_oneof:"result"` + state protoimpl.MessageState `protogen:"open.v1"` + Bot *Bot `protobuf:"bytes,1,opt,name=bot,proto3" json:"bot,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -337,47 +294,13 @@ func (*GetBotByUsernameResponse) Descriptor() ([]byte, []int) { return file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP(), []int{5} } -func (x *GetBotByUsernameResponse) GetResult() isGetBotByUsernameResponse_Result { +func (x *GetBotByUsernameResponse) GetBot() *Bot { if x != nil { - return x.Result - } - return nil -} - -func (x *GetBotByUsernameResponse) GetSuccess() *GetBotByUsernameResponse_Success { - if x != nil { - if x, ok := x.Result.(*GetBotByUsernameResponse_Success_); ok { - return x.Success - } - } - return nil -} - -func (x *GetBotByUsernameResponse) GetError() *v1.Error { - if x != nil { - if x, ok := x.Result.(*GetBotByUsernameResponse_Error); ok { - return x.Error - } + return x.Bot } return nil } -type isGetBotByUsernameResponse_Result interface { - isGetBotByUsernameResponse_Result() -} - -type GetBotByUsernameResponse_Success_ struct { - Success *GetBotByUsernameResponse_Success `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type GetBotByUsernameResponse_Error struct { - Error *v1.Error `protobuf:"bytes,2,opt,name=error,proto3,oneof"` -} - -func (*GetBotByUsernameResponse_Success_) isGetBotByUsernameResponse_Result() {} - -func (*GetBotByUsernameResponse_Error) isGetBotByUsernameResponse_Result() {} - type Bot struct { state protoimpl.MessageState `protogen:"open.v1"` BotId string `protobuf:"bytes,1,opt,name=bot_id,json=botId,proto3" json:"bot_id,omitempty"` @@ -430,99 +353,11 @@ func (x *Bot) GetUsername() string { return "" } -type RegisterBotResponse_Success struct { - state protoimpl.MessageState `protogen:"open.v1"` - BotId string `protobuf:"bytes,1,opt,name=bot_id,json=botId,proto3" json:"bot_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RegisterBotResponse_Success) Reset() { - *x = RegisterBotResponse_Success{} - mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RegisterBotResponse_Success) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterBotResponse_Success) ProtoMessage() {} - -func (x *RegisterBotResponse_Success) ProtoReflect() protoreflect.Message { - mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RegisterBotResponse_Success.ProtoReflect.Descriptor instead. -func (*RegisterBotResponse_Success) Descriptor() ([]byte, []int) { - return file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *RegisterBotResponse_Success) GetBotId() string { - if x != nil { - return x.BotId - } - return "" -} - -type GetBotByUsernameResponse_Success struct { - state protoimpl.MessageState `protogen:"open.v1"` - Bot *Bot `protobuf:"bytes,1,opt,name=bot,proto3" json:"bot,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBotByUsernameResponse_Success) Reset() { - *x = GetBotByUsernameResponse_Success{} - mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBotByUsernameResponse_Success) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBotByUsernameResponse_Success) ProtoMessage() {} - -func (x *GetBotByUsernameResponse_Success) ProtoReflect() protoreflect.Message { - mi := &file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBotByUsernameResponse_Success.ProtoReflect.Descriptor instead. -func (*GetBotByUsernameResponse_Success) Descriptor() ([]byte, []int) { - return file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *GetBotByUsernameResponse_Success) GetBot() *Bot { - if x != nil { - return x.Bot - } - return nil -} - var File_gamingplatform_api_identity_v1_messaging_proto protoreflect.FileDescriptor const file_gamingplatform_api_identity_v1_messaging_proto_rawDesc = "" + "\n" + - ".gamingplatform/api/identity/v1/messaging.proto\x12\x1egamingplatform.api.identity.v1\x1a,gamingplatform/api/common/v1/messaging.proto\"&\n" + + ".gamingplatform/api/identity/v1/messaging.proto\x12\x1egamingplatform.api.identity.v1\"&\n" + "\vUserArrived\x12\x17\n" + "\auser_id\x18\x01 \x01(\tR\x06userId\"Y\n" + "\fUserSignedUp\x12\x17\n" + @@ -530,21 +365,13 @@ const file_gamingplatform_api_identity_v1_messaging_proto_rawDesc = "" + "\busername\x18\x02 \x01(\tR\busername\x12\x14\n" + "\x05email\x18\x03 \x01(\tR\x05email\")\n" + "\vRegisterBot\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\"\xd7\x01\n" + - "\x13RegisterBotResponse\x12W\n" + - "\asuccess\x18\x01 \x01(\v2;.gamingplatform.api.identity.v1.RegisterBotResponse.SuccessH\x00R\asuccess\x12;\n" + - "\x05error\x18\x02 \x01(\v2#.gamingplatform.api.common.v1.ErrorH\x00R\x05error\x1a \n" + - "\aSuccess\x12\x15\n" + - "\x06bot_id\x18\x01 \x01(\tR\x05botIdB\b\n" + - "\x06result\".\n" + + "\busername\x18\x01 \x01(\tR\busername\",\n" + + "\x13RegisterBotResponse\x12\x15\n" + + "\x06bot_id\x18\x01 \x01(\tR\x05botId\".\n" + "\x10GetBotByUsername\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\"\x81\x02\n" + - "\x18GetBotByUsernameResponse\x12\\\n" + - "\asuccess\x18\x01 \x01(\v2@.gamingplatform.api.identity.v1.GetBotByUsernameResponse.SuccessH\x00R\asuccess\x12;\n" + - "\x05error\x18\x02 \x01(\v2#.gamingplatform.api.common.v1.ErrorH\x00R\x05error\x1a@\n" + - "\aSuccess\x125\n" + - "\x03bot\x18\x01 \x01(\v2#.gamingplatform.api.identity.v1.BotR\x03botB\b\n" + - "\x06result\"8\n" + + "\busername\x18\x01 \x01(\tR\busername\"Q\n" + + "\x18GetBotByUsernameResponse\x125\n" + + "\x03bot\x18\x01 \x01(\v2#.gamingplatform.api.identity.v1.BotR\x03bot\"8\n" + "\x03Bot\x12\x15\n" + "\x06bot_id\x18\x01 \x01(\tR\x05botId\x12\x1a\n" + "\busername\x18\x02 \x01(\tR\busernameB\x88\x01Z8github.com/gaming-platform/api/go/identity/v1;identityv1\xca\x02\x1eGamingPlatform\\Api\\Identity\\V1\xe2\x02*GamingPlatform\\Api\\GPBMetadata\\Identity\\V1b\x06proto3" @@ -561,30 +388,23 @@ func file_gamingplatform_api_identity_v1_messaging_proto_rawDescGZIP() []byte { return file_gamingplatform_api_identity_v1_messaging_proto_rawDescData } -var file_gamingplatform_api_identity_v1_messaging_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_gamingplatform_api_identity_v1_messaging_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_gamingplatform_api_identity_v1_messaging_proto_goTypes = []any{ - (*UserArrived)(nil), // 0: gamingplatform.api.identity.v1.UserArrived - (*UserSignedUp)(nil), // 1: gamingplatform.api.identity.v1.UserSignedUp - (*RegisterBot)(nil), // 2: gamingplatform.api.identity.v1.RegisterBot - (*RegisterBotResponse)(nil), // 3: gamingplatform.api.identity.v1.RegisterBotResponse - (*GetBotByUsername)(nil), // 4: gamingplatform.api.identity.v1.GetBotByUsername - (*GetBotByUsernameResponse)(nil), // 5: gamingplatform.api.identity.v1.GetBotByUsernameResponse - (*Bot)(nil), // 6: gamingplatform.api.identity.v1.Bot - (*RegisterBotResponse_Success)(nil), // 7: gamingplatform.api.identity.v1.RegisterBotResponse.Success - (*GetBotByUsernameResponse_Success)(nil), // 8: gamingplatform.api.identity.v1.GetBotByUsernameResponse.Success - (*v1.Error)(nil), // 9: gamingplatform.api.common.v1.Error + (*UserArrived)(nil), // 0: gamingplatform.api.identity.v1.UserArrived + (*UserSignedUp)(nil), // 1: gamingplatform.api.identity.v1.UserSignedUp + (*RegisterBot)(nil), // 2: gamingplatform.api.identity.v1.RegisterBot + (*RegisterBotResponse)(nil), // 3: gamingplatform.api.identity.v1.RegisterBotResponse + (*GetBotByUsername)(nil), // 4: gamingplatform.api.identity.v1.GetBotByUsername + (*GetBotByUsernameResponse)(nil), // 5: gamingplatform.api.identity.v1.GetBotByUsernameResponse + (*Bot)(nil), // 6: gamingplatform.api.identity.v1.Bot } var file_gamingplatform_api_identity_v1_messaging_proto_depIdxs = []int32{ - 7, // 0: gamingplatform.api.identity.v1.RegisterBotResponse.success:type_name -> gamingplatform.api.identity.v1.RegisterBotResponse.Success - 9, // 1: gamingplatform.api.identity.v1.RegisterBotResponse.error:type_name -> gamingplatform.api.common.v1.Error - 8, // 2: gamingplatform.api.identity.v1.GetBotByUsernameResponse.success:type_name -> gamingplatform.api.identity.v1.GetBotByUsernameResponse.Success - 9, // 3: gamingplatform.api.identity.v1.GetBotByUsernameResponse.error:type_name -> gamingplatform.api.common.v1.Error - 6, // 4: gamingplatform.api.identity.v1.GetBotByUsernameResponse.Success.bot:type_name -> gamingplatform.api.identity.v1.Bot - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] 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 + 6, // 0: gamingplatform.api.identity.v1.GetBotByUsernameResponse.bot:type_name -> gamingplatform.api.identity.v1.Bot + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_gamingplatform_api_identity_v1_messaging_proto_init() } @@ -592,21 +412,13 @@ func file_gamingplatform_api_identity_v1_messaging_proto_init() { if File_gamingplatform_api_identity_v1_messaging_proto != nil { return } - file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[3].OneofWrappers = []any{ - (*RegisterBotResponse_Success_)(nil), - (*RegisterBotResponse_Error)(nil), - } - file_gamingplatform_api_identity_v1_messaging_proto_msgTypes[5].OneofWrappers = []any{ - (*GetBotByUsernameResponse_Success_)(nil), - (*GetBotByUsernameResponse_Error)(nil), - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_gamingplatform_api_identity_v1_messaging_proto_rawDesc), len(file_gamingplatform_api_identity_v1_messaging_proto_rawDesc)), NumEnums: 0, - NumMessages: 9, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/php/GamingPlatform/Api/Common/V1/CommonV1Factory.php b/php/GamingPlatform/Api/Common/V1/CommonV1Factory.php index 6782ec0..68b9c79 100644 --- a/php/GamingPlatform/Api/Common/V1/CommonV1Factory.php +++ b/php/GamingPlatform/Api/Common/V1/CommonV1Factory.php @@ -8,31 +8,31 @@ final class CommonV1Factory { - public static function createError_Violation_Parameter( + public static function createErrorResponse_Violation_Parameter( string $data - ): \GamingPlatform\Api\Common\V1\Error\Violation\Parameter { + ): \GamingPlatform\Api\Common\V1\ErrorResponse\Violation\Parameter { static $template; - $template ??= new \GamingPlatform\Api\Common\V1\Error\Violation\Parameter(); + $template ??= new \GamingPlatform\Api\Common\V1\ErrorResponse\Violation\Parameter(); $message = clone $template; $message->mergeFromString($data); return $message; } - public static function createError_Violation( + public static function createErrorResponse_Violation( string $data - ): \GamingPlatform\Api\Common\V1\Error\Violation { + ): \GamingPlatform\Api\Common\V1\ErrorResponse\Violation { static $template; - $template ??= new \GamingPlatform\Api\Common\V1\Error\Violation(); + $template ??= new \GamingPlatform\Api\Common\V1\ErrorResponse\Violation(); $message = clone $template; $message->mergeFromString($data); return $message; } - public static function createError( + public static function createErrorResponse( string $data - ): \GamingPlatform\Api\Common\V1\Error { + ): \GamingPlatform\Api\Common\V1\ErrorResponse { static $template; - $template ??= new \GamingPlatform\Api\Common\V1\Error(); + $template ??= new \GamingPlatform\Api\Common\V1\ErrorResponse(); $message = clone $template; $message->mergeFromString($data); return $message; diff --git a/php/GamingPlatform/Api/Common/V1/Error.php b/php/GamingPlatform/Api/Common/V1/ErrorResponse.php similarity index 70% rename from php/GamingPlatform/Api/Common/V1/Error.php rename to php/GamingPlatform/Api/Common/V1/ErrorResponse.php index 45a9390..cc13067 100644 --- a/php/GamingPlatform/Api/Common/V1/Error.php +++ b/php/GamingPlatform/Api/Common/V1/ErrorResponse.php @@ -9,12 +9,12 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Generated from protobuf message gamingplatform.api.common.v1.Error + * Generated from protobuf message gamingplatform.api.common.v1.ErrorResponse */ -class Error extends \Google\Protobuf\Internal\Message +class ErrorResponse extends \Google\Protobuf\Internal\Message { /** - * Generated from protobuf field repeated .gamingplatform.api.common.v1.Error.Violation violations = 1; + * Generated from protobuf field repeated .gamingplatform.api.common.v1.ErrorResponse.Violation violations = 1; */ private $violations; @@ -24,7 +24,7 @@ class Error extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type array<\GamingPlatform\Api\Common\V1\Error\Violation>|\Google\Protobuf\Internal\RepeatedField $violations + * @type array<\GamingPlatform\Api\Common\V1\ErrorResponse\Violation>|\Google\Protobuf\Internal\RepeatedField $violations * } */ public function __construct($data = NULL) { @@ -33,7 +33,7 @@ public function __construct($data = NULL) { } /** - * Generated from protobuf field repeated .gamingplatform.api.common.v1.Error.Violation violations = 1; + * Generated from protobuf field repeated .gamingplatform.api.common.v1.ErrorResponse.Violation violations = 1; * @return \Google\Protobuf\Internal\RepeatedField */ public function getViolations() @@ -42,13 +42,13 @@ public function getViolations() } /** - * Generated from protobuf field repeated .gamingplatform.api.common.v1.Error.Violation violations = 1; - * @param array<\GamingPlatform\Api\Common\V1\Error\Violation>|\Google\Protobuf\Internal\RepeatedField $var + * Generated from protobuf field repeated .gamingplatform.api.common.v1.ErrorResponse.Violation violations = 1; + * @param array<\GamingPlatform\Api\Common\V1\ErrorResponse\Violation>|\Google\Protobuf\Internal\RepeatedField $var * @return $this */ public function setViolations($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \GamingPlatform\Api\Common\V1\Error\Violation::class); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \GamingPlatform\Api\Common\V1\ErrorResponse\Violation::class); $this->violations = $arr; return $this; diff --git a/php/GamingPlatform/Api/Common/V1/Error/Violation.php b/php/GamingPlatform/Api/Common/V1/ErrorResponse/Violation.php similarity index 81% rename from php/GamingPlatform/Api/Common/V1/Error/Violation.php rename to php/GamingPlatform/Api/Common/V1/ErrorResponse/Violation.php index 371916f..5a0802a 100644 --- a/php/GamingPlatform/Api/Common/V1/Error/Violation.php +++ b/php/GamingPlatform/Api/Common/V1/ErrorResponse/Violation.php @@ -2,14 +2,14 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: gamingplatform/api/common/v1/messaging.proto -namespace GamingPlatform\Api\Common\V1\Error; +namespace GamingPlatform\Api\Common\V1\ErrorResponse; use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; /** - * Generated from protobuf message gamingplatform.api.common.v1.Error.Violation + * Generated from protobuf message gamingplatform.api.common.v1.ErrorResponse.Violation */ class Violation extends \Google\Protobuf\Internal\Message { @@ -22,7 +22,7 @@ class Violation extends \Google\Protobuf\Internal\Message */ protected $identifier = ''; /** - * Generated from protobuf field repeated .gamingplatform.api.common.v1.Error.Violation.Parameter parameters = 3; + * Generated from protobuf field repeated .gamingplatform.api.common.v1.ErrorResponse.Violation.Parameter parameters = 3; */ private $parameters; @@ -34,7 +34,7 @@ class Violation extends \Google\Protobuf\Internal\Message * * @type string $property_path * @type string $identifier - * @type array<\GamingPlatform\Api\Common\V1\Error\Violation\Parameter>|\Google\Protobuf\Internal\RepeatedField $parameters + * @type array<\GamingPlatform\Api\Common\V1\ErrorResponse\Violation\Parameter>|\Google\Protobuf\Internal\RepeatedField $parameters * } */ public function __construct($data = NULL) { @@ -87,7 +87,7 @@ public function setIdentifier($var) } /** - * Generated from protobuf field repeated .gamingplatform.api.common.v1.Error.Violation.Parameter parameters = 3; + * Generated from protobuf field repeated .gamingplatform.api.common.v1.ErrorResponse.Violation.Parameter parameters = 3; * @return \Google\Protobuf\Internal\RepeatedField */ public function getParameters() @@ -96,13 +96,13 @@ public function getParameters() } /** - * Generated from protobuf field repeated .gamingplatform.api.common.v1.Error.Violation.Parameter parameters = 3; - * @param array<\GamingPlatform\Api\Common\V1\Error\Violation\Parameter>|\Google\Protobuf\Internal\RepeatedField $var + * Generated from protobuf field repeated .gamingplatform.api.common.v1.ErrorResponse.Violation.Parameter parameters = 3; + * @param array<\GamingPlatform\Api\Common\V1\ErrorResponse\Violation\Parameter>|\Google\Protobuf\Internal\RepeatedField $var * @return $this */ public function setParameters($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \GamingPlatform\Api\Common\V1\Error\Violation\Parameter::class); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \GamingPlatform\Api\Common\V1\ErrorResponse\Violation\Parameter::class); $this->parameters = $arr; return $this; @@ -111,5 +111,5 @@ public function setParameters($var) } // Adding a class alias for backwards compatibility with the previous class name. -class_alias(Violation::class, \GamingPlatform\Api\Common\V1\Error_Violation::class); +class_alias(Violation::class, \GamingPlatform\Api\Common\V1\ErrorResponse_Violation::class); diff --git a/php/GamingPlatform/Api/Common/V1/Error/Violation/Parameter.php b/php/GamingPlatform/Api/Common/V1/ErrorResponse/Violation/Parameter.php similarity index 96% rename from php/GamingPlatform/Api/Common/V1/Error/Violation/Parameter.php rename to php/GamingPlatform/Api/Common/V1/ErrorResponse/Violation/Parameter.php index c565648..bd1cc7e 100644 --- a/php/GamingPlatform/Api/Common/V1/Error/Violation/Parameter.php +++ b/php/GamingPlatform/Api/Common/V1/ErrorResponse/Violation/Parameter.php @@ -2,14 +2,14 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: gamingplatform/api/common/v1/messaging.proto -namespace GamingPlatform\Api\Common\V1\Error\Violation; +namespace GamingPlatform\Api\Common\V1\ErrorResponse\Violation; use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; /** - * Generated from protobuf message gamingplatform.api.common.v1.Error.Violation.Parameter + * Generated from protobuf message gamingplatform.api.common.v1.ErrorResponse.Violation.Parameter */ class Parameter extends \Google\Protobuf\Internal\Message { @@ -178,5 +178,5 @@ public function getValue() } // Adding a class alias for backwards compatibility with the previous class name. -class_alias(Parameter::class, \GamingPlatform\Api\Common\V1\Error_Violation_Parameter::class); +class_alias(Parameter::class, \GamingPlatform\Api\Common\V1\ErrorResponse_Violation_Parameter::class); diff --git a/php/GamingPlatform/Api/GPBMetadata/Common/V1/Messaging.php b/php/GamingPlatform/Api/GPBMetadata/Common/V1/Messaging.php index 81677fb974e119edfa66d9f0b69418682bb6f554..28f9bbc1668a7385b5c9641246670522c388dcf9 100644 GIT binary patch delta 128 zcmcc3@tI@8Q%05pEL=Jhy>%vwGRdnyW8&gWI74qcbD$C5zNi4|( zawQlQm^HYKOeddbQWk+J(F=pgOLb0eVzLko=He%vwGRe!IW8z|UEh@?{5_06?D$C5zNi50C&nuQ-RAAQN wHqxDZpGlcVFAOFw)i`+)lZB`^7gs@IQDSatNorBC1T$EvIY{YdF6K-|0B3O?bN~PV diff --git a/php/GamingPlatform/Api/GPBMetadata/Identity/V1/Messaging.php b/php/GamingPlatform/Api/GPBMetadata/Identity/V1/Messaging.php index 6fa7fe86bf384bfd2645c39b7c60b65206a0ac5e..c9e84839f3fa24908ab56b235e0cd647af2c8880 100644 GIT binary patch delta 101 zcmaFC{fJ}3F2>2sO!_RVSh(~idh1P2VOpZ5$|W3>nx0u)l3L`HUlNpBT#%nvoGQe} z#g>#`5}%nO!KlEf!8!R9vpTa6m&9ZT770!v11@Huqy*#STo$Rxl}y~sdQSP9@3C+( F0ss_l93%h$ delta 303 zcmaFF@q&B9E=IT7&W+!to0_#GRbM`1*N8E7MG+JIpvoG zr4|?D=M|^w1w&MNFbJ7&v8EOkBPasR+L&?no~0QDU&+W8^+1J%+kWa=.gamingplatform.api.identity.v1.Bot bot = 1; + */ + protected $bot = null; /** * Constructor. @@ -21,8 +24,7 @@ class GetBotByUsernameResponse extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse\Success $success - * @type \GamingPlatform\Api\Common\V1\Error $error + * @type \GamingPlatform\Api\Identity\V1\Bot $bot * } */ public function __construct($data = NULL) { @@ -31,66 +33,36 @@ public function __construct($data = NULL) { } /** - * Generated from protobuf field .gamingplatform.api.identity.v1.GetBotByUsernameResponse.Success success = 1; - * @return \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse\Success|null - */ - public function getSuccess() - { - return $this->readOneof(1); - } - - public function hasSuccess() - { - return $this->hasOneof(1); - } - - /** - * Generated from protobuf field .gamingplatform.api.identity.v1.GetBotByUsernameResponse.Success success = 1; - * @param \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse\Success $var - * @return $this + * Generated from protobuf field .gamingplatform.api.identity.v1.Bot bot = 1; + * @return \GamingPlatform\Api\Identity\V1\Bot|null */ - public function setSuccess($var) + public function getBot() { - GPBUtil::checkMessage($var, \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse\Success::class); - $this->writeOneof(1, $var); - - return $this; + return $this->bot; } - /** - * Generated from protobuf field .gamingplatform.api.common.v1.Error error = 2; - * @return \GamingPlatform\Api\Common\V1\Error|null - */ - public function getError() + public function hasBot() { - return $this->readOneof(2); + return isset($this->bot); } - public function hasError() + public function clearBot() { - return $this->hasOneof(2); + unset($this->bot); } /** - * Generated from protobuf field .gamingplatform.api.common.v1.Error error = 2; - * @param \GamingPlatform\Api\Common\V1\Error $var + * Generated from protobuf field .gamingplatform.api.identity.v1.Bot bot = 1; + * @param \GamingPlatform\Api\Identity\V1\Bot $var * @return $this */ - public function setError($var) + public function setBot($var) { - GPBUtil::checkMessage($var, \GamingPlatform\Api\Common\V1\Error::class); - $this->writeOneof(2, $var); + GPBUtil::checkMessage($var, \GamingPlatform\Api\Identity\V1\Bot::class); + $this->bot = $var; return $this; } - /** - * @return string - */ - public function getResult() - { - return $this->whichOneof("result"); - } - } diff --git a/php/GamingPlatform/Api/Identity/V1/GetBotByUsernameResponse/Success.php b/php/GamingPlatform/Api/Identity/V1/GetBotByUsernameResponse/Success.php deleted file mode 100644 index 94a8039..0000000 --- a/php/GamingPlatform/Api/Identity/V1/GetBotByUsernameResponse/Success.php +++ /dev/null @@ -1,71 +0,0 @@ -gamingplatform.api.identity.v1.GetBotByUsernameResponse.Success - */ -class Success extends \Google\Protobuf\Internal\Message -{ - /** - * Generated from protobuf field .gamingplatform.api.identity.v1.Bot bot = 1; - */ - protected $bot = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \GamingPlatform\Api\Identity\V1\Bot $bot - * } - */ - public function __construct($data = NULL) { - \GamingPlatform\Api\GPBMetadata\Identity\V1\Messaging::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field .gamingplatform.api.identity.v1.Bot bot = 1; - * @return \GamingPlatform\Api\Identity\V1\Bot|null - */ - public function getBot() - { - return $this->bot; - } - - public function hasBot() - { - return isset($this->bot); - } - - public function clearBot() - { - unset($this->bot); - } - - /** - * Generated from protobuf field .gamingplatform.api.identity.v1.Bot bot = 1; - * @param \GamingPlatform\Api\Identity\V1\Bot $var - * @return $this - */ - public function setBot($var) - { - GPBUtil::checkMessage($var, \GamingPlatform\Api\Identity\V1\Bot::class); - $this->bot = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Success::class, \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse_Success::class); - diff --git a/php/GamingPlatform/Api/Identity/V1/IdentityV1Factory.php b/php/GamingPlatform/Api/Identity/V1/IdentityV1Factory.php index ae853d6..b164f73 100644 --- a/php/GamingPlatform/Api/Identity/V1/IdentityV1Factory.php +++ b/php/GamingPlatform/Api/Identity/V1/IdentityV1Factory.php @@ -28,16 +28,6 @@ public static function createGetBotByUsername( return $message; } - public static function createGetBotByUsernameResponse_Success( - string $data - ): \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse\Success { - static $template; - $template ??= new \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse\Success(); - $message = clone $template; - $message->mergeFromString($data); - return $message; - } - public static function createGetBotByUsernameResponse( string $data ): \GamingPlatform\Api\Identity\V1\GetBotByUsernameResponse { @@ -58,16 +48,6 @@ public static function createRegisterBot( return $message; } - public static function createRegisterBotResponse_Success( - string $data - ): \GamingPlatform\Api\Identity\V1\RegisterBotResponse\Success { - static $template; - $template ??= new \GamingPlatform\Api\Identity\V1\RegisterBotResponse\Success(); - $message = clone $template; - $message->mergeFromString($data); - return $message; - } - public static function createRegisterBotResponse( string $data ): \GamingPlatform\Api\Identity\V1\RegisterBotResponse { diff --git a/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse.php b/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse.php index 7323fd6..47938eb 100644 --- a/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse.php +++ b/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse.php @@ -13,7 +13,10 @@ */ class RegisterBotResponse extends \Google\Protobuf\Internal\Message { - protected $result; + /** + * Generated from protobuf field string bot_id = 1; + */ + protected $bot_id = ''; /** * Constructor. @@ -21,8 +24,7 @@ class RegisterBotResponse extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type \GamingPlatform\Api\Identity\V1\RegisterBotResponse\Success $success - * @type \GamingPlatform\Api\Common\V1\Error $error + * @type string $bot_id * } */ public function __construct($data = NULL) { @@ -31,66 +33,26 @@ public function __construct($data = NULL) { } /** - * Generated from protobuf field .gamingplatform.api.identity.v1.RegisterBotResponse.Success success = 1; - * @return \GamingPlatform\Api\Identity\V1\RegisterBotResponse\Success|null - */ - public function getSuccess() - { - return $this->readOneof(1); - } - - public function hasSuccess() - { - return $this->hasOneof(1); - } - - /** - * Generated from protobuf field .gamingplatform.api.identity.v1.RegisterBotResponse.Success success = 1; - * @param \GamingPlatform\Api\Identity\V1\RegisterBotResponse\Success $var - * @return $this - */ - public function setSuccess($var) - { - GPBUtil::checkMessage($var, \GamingPlatform\Api\Identity\V1\RegisterBotResponse\Success::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Generated from protobuf field .gamingplatform.api.common.v1.Error error = 2; - * @return \GamingPlatform\Api\Common\V1\Error|null + * Generated from protobuf field string bot_id = 1; + * @return string */ - public function getError() - { - return $this->readOneof(2); - } - - public function hasError() + public function getBotId() { - return $this->hasOneof(2); + return $this->bot_id; } /** - * Generated from protobuf field .gamingplatform.api.common.v1.Error error = 2; - * @param \GamingPlatform\Api\Common\V1\Error $var + * Generated from protobuf field string bot_id = 1; + * @param string $var * @return $this */ - public function setError($var) + public function setBotId($var) { - GPBUtil::checkMessage($var, \GamingPlatform\Api\Common\V1\Error::class); - $this->writeOneof(2, $var); + GPBUtil::checkString($var, True); + $this->bot_id = $var; return $this; } - /** - * @return string - */ - public function getResult() - { - return $this->whichOneof("result"); - } - } diff --git a/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse/Success.php b/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse/Success.php deleted file mode 100644 index 9cc31ef..0000000 --- a/php/GamingPlatform/Api/Identity/V1/RegisterBotResponse/Success.php +++ /dev/null @@ -1,61 +0,0 @@ -gamingplatform.api.identity.v1.RegisterBotResponse.Success - */ -class Success extends \Google\Protobuf\Internal\Message -{ - /** - * Generated from protobuf field string bot_id = 1; - */ - protected $bot_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $bot_id - * } - */ - public function __construct($data = NULL) { - \GamingPlatform\Api\GPBMetadata\Identity\V1\Messaging::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field string bot_id = 1; - * @return string - */ - public function getBotId() - { - return $this->bot_id; - } - - /** - * Generated from protobuf field string bot_id = 1; - * @param string $var - * @return $this - */ - public function setBotId($var) - { - GPBUtil::checkString($var, True); - $this->bot_id = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Success::class, \GamingPlatform\Api\Identity\V1\RegisterBotResponse_Success::class); - diff --git a/project b/project index 921751d..9cca1aa 100755 --- a/project +++ b/project @@ -13,6 +13,7 @@ help() { } protoc() { + rm -rf ./go/* ./php/* docker compose run --rm protoc docker run \ --rm \ diff --git a/schema/gamingplatform/api/common/v1/messaging.proto b/schema/gamingplatform/api/common/v1/messaging.proto index d7ba832..70cb94b 100644 --- a/schema/gamingplatform/api/common/v1/messaging.proto +++ b/schema/gamingplatform/api/common/v1/messaging.proto @@ -6,7 +6,7 @@ option go_package = "github.com/gaming-platform/api/go/common/v1;commonv1"; option php_namespace = "GamingPlatform\\Api\\Common\\V1"; option php_metadata_namespace = "GamingPlatform\\Api\\GPBMetadata\\Common\\V1"; -message Error { +message ErrorResponse { message Violation { message Parameter { string name = 1; diff --git a/schema/gamingplatform/api/identity/v1/messaging.proto b/schema/gamingplatform/api/identity/v1/messaging.proto index 3148ba5..d70abeb 100644 --- a/schema/gamingplatform/api/identity/v1/messaging.proto +++ b/schema/gamingplatform/api/identity/v1/messaging.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package gamingplatform.api.identity.v1; -import "gamingplatform/api/common/v1/messaging.proto"; - option go_package = "github.com/gaming-platform/api/go/identity/v1;identityv1"; option php_namespace = "GamingPlatform\\Api\\Identity\\V1"; option php_metadata_namespace = "GamingPlatform\\Api\\GPBMetadata\\Identity\\V1"; @@ -23,8 +21,7 @@ message RegisterBot { } message RegisterBotResponse { - message Success {string bot_id = 1;} - oneof result {Success success = 1; gamingplatform.api.common.v1.Error error = 2;} + string bot_id = 1; } message GetBotByUsername { @@ -32,8 +29,7 @@ message GetBotByUsername { } message GetBotByUsernameResponse { - message Success {Bot bot = 1;} - oneof result {Success success = 1; gamingplatform.api.common.v1.Error error = 2;} + Bot bot = 1; } message Bot { From ea888c2bd40c274452419d206204c9870c51fdf0 Mon Sep 17 00:00:00 2001 From: Markus Reinhold Date: Mon, 1 Dec 2025 23:08:40 +0100 Subject: [PATCH 5/5] Use only string for parameter values --- go/common/v1/messaging.pb.go | 100 ++------------- .../V1/ErrorResponse/Violation/Parameter.php | 116 ++---------------- .../Api/GPBMetadata/Common/V1/Messaging.php | Bin 1139 -> 1055 bytes .../api/common/v1/messaging.proto | 2 +- 4 files changed, 21 insertions(+), 197 deletions(-) diff --git a/go/common/v1/messaging.pb.go b/go/common/v1/messaging.pb.go index 0340d90..99f4387 100644 --- a/go/common/v1/messaging.pb.go +++ b/go/common/v1/messaging.pb.go @@ -126,15 +126,9 @@ func (x *ErrorResponse_Violation) GetParameters() []*ErrorResponse_Violation_Par } type ErrorResponse_Violation_Parameter struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Types that are valid to be assigned to Value: - // - // *ErrorResponse_Violation_Parameter_BoolValue - // *ErrorResponse_Violation_Parameter_IntValue - // *ErrorResponse_Violation_Parameter_FloatValue - // *ErrorResponse_Violation_Parameter_StringValue - Value isErrorResponse_Violation_Parameter_Value `protobuf_oneof:"value"` + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -176,86 +170,22 @@ func (x *ErrorResponse_Violation_Parameter) GetName() string { return "" } -func (x *ErrorResponse_Violation_Parameter) GetValue() isErrorResponse_Violation_Parameter_Value { +func (x *ErrorResponse_Violation_Parameter) GetValue() string { if x != nil { return x.Value } - return nil -} - -func (x *ErrorResponse_Violation_Parameter) GetBoolValue() bool { - if x != nil { - if x, ok := x.Value.(*ErrorResponse_Violation_Parameter_BoolValue); ok { - return x.BoolValue - } - } - return false -} - -func (x *ErrorResponse_Violation_Parameter) GetIntValue() int64 { - if x != nil { - if x, ok := x.Value.(*ErrorResponse_Violation_Parameter_IntValue); ok { - return x.IntValue - } - } - return 0 -} - -func (x *ErrorResponse_Violation_Parameter) GetFloatValue() float32 { - if x != nil { - if x, ok := x.Value.(*ErrorResponse_Violation_Parameter_FloatValue); ok { - return x.FloatValue - } - } - return 0 -} - -func (x *ErrorResponse_Violation_Parameter) GetStringValue() string { - if x != nil { - if x, ok := x.Value.(*ErrorResponse_Violation_Parameter_StringValue); ok { - return x.StringValue - } - } return "" } -type isErrorResponse_Violation_Parameter_Value interface { - isErrorResponse_Violation_Parameter_Value() -} - -type ErrorResponse_Violation_Parameter_BoolValue struct { - BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"` -} - -type ErrorResponse_Violation_Parameter_IntValue struct { - IntValue int64 `protobuf:"varint,3,opt,name=int_value,json=intValue,proto3,oneof"` -} - -type ErrorResponse_Violation_Parameter_FloatValue struct { - FloatValue float32 `protobuf:"fixed32,4,opt,name=float_value,json=floatValue,proto3,oneof"` -} - -type ErrorResponse_Violation_Parameter_StringValue struct { - StringValue string `protobuf:"bytes,5,opt,name=string_value,json=stringValue,proto3,oneof"` -} - -func (*ErrorResponse_Violation_Parameter_BoolValue) isErrorResponse_Violation_Parameter_Value() {} - -func (*ErrorResponse_Violation_Parameter_IntValue) isErrorResponse_Violation_Parameter_Value() {} - -func (*ErrorResponse_Violation_Parameter_FloatValue) isErrorResponse_Violation_Parameter_Value() {} - -func (*ErrorResponse_Violation_Parameter_StringValue) isErrorResponse_Violation_Parameter_Value() {} - var File_gamingplatform_api_common_v1_messaging_proto protoreflect.FileDescriptor const file_gamingplatform_api_common_v1_messaging_proto_rawDesc = "" + "\n" + - ",gamingplatform/api/common/v1/messaging.proto\x12\x1cgamingplatform.api.common.v1\"\xcd\x03\n" + + ",gamingplatform/api/common/v1/messaging.proto\x12\x1cgamingplatform.api.common.v1\"\xd1\x02\n" + "\rErrorResponse\x12U\n" + "\n" + "violations\x18\x01 \x03(\v25.gamingplatform.api.common.v1.ErrorResponse.ViolationR\n" + - "violations\x1a\xe4\x02\n" + + "violations\x1a\xe8\x01\n" + "\tViolation\x12#\n" + "\rproperty_path\x18\x01 \x01(\tR\fpropertyPath\x12\x1e\n" + "\n" + @@ -263,16 +193,10 @@ const file_gamingplatform_api_common_v1_messaging_proto_rawDesc = "" + "identifier\x12_\n" + "\n" + "parameters\x18\x03 \x03(\v2?.gamingplatform.api.common.v1.ErrorResponse.Violation.ParameterR\n" + - "parameters\x1a\xb0\x01\n" + + "parameters\x1a5\n" + "\tParameter\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x1f\n" + - "\n" + - "bool_value\x18\x02 \x01(\bH\x00R\tboolValue\x12\x1d\n" + - "\tint_value\x18\x03 \x01(\x03H\x00R\bintValue\x12!\n" + - "\vfloat_value\x18\x04 \x01(\x02H\x00R\n" + - "floatValue\x12#\n" + - "\fstring_value\x18\x05 \x01(\tH\x00R\vstringValueB\a\n" + - "\x05valueB\x80\x01Z4github.com/gaming-platform/api/go/common/v1;commonv1\xca\x02\x1cGamingPlatform\\Api\\Common\\V1\xe2\x02(GamingPlatform\\Api\\GPBMetadata\\Common\\V1b\x06proto3" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05valueB\x80\x01Z4github.com/gaming-platform/api/go/common/v1;commonv1\xca\x02\x1cGamingPlatform\\Api\\Common\\V1\xe2\x02(GamingPlatform\\Api\\GPBMetadata\\Common\\V1b\x06proto3" var ( file_gamingplatform_api_common_v1_messaging_proto_rawDescOnce sync.Once @@ -307,12 +231,6 @@ func file_gamingplatform_api_common_v1_messaging_proto_init() { if File_gamingplatform_api_common_v1_messaging_proto != nil { return } - file_gamingplatform_api_common_v1_messaging_proto_msgTypes[2].OneofWrappers = []any{ - (*ErrorResponse_Violation_Parameter_BoolValue)(nil), - (*ErrorResponse_Violation_Parameter_IntValue)(nil), - (*ErrorResponse_Violation_Parameter_FloatValue)(nil), - (*ErrorResponse_Violation_Parameter_StringValue)(nil), - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/php/GamingPlatform/Api/Common/V1/ErrorResponse/Violation/Parameter.php b/php/GamingPlatform/Api/Common/V1/ErrorResponse/Violation/Parameter.php index bd1cc7e..058d317 100644 --- a/php/GamingPlatform/Api/Common/V1/ErrorResponse/Violation/Parameter.php +++ b/php/GamingPlatform/Api/Common/V1/ErrorResponse/Violation/Parameter.php @@ -17,7 +17,10 @@ class Parameter extends \Google\Protobuf\Internal\Message * Generated from protobuf field string name = 1; */ protected $name = ''; - protected $value; + /** + * Generated from protobuf field string value = 2; + */ + protected $value = ''; /** * Constructor. @@ -26,10 +29,7 @@ class Parameter extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * @type bool $bool_value - * @type int|string $int_value - * @type float $float_value - * @type string $string_value + * @type string $value * } */ public function __construct($data = NULL) { @@ -60,121 +60,27 @@ public function setName($var) } /** - * Generated from protobuf field bool bool_value = 2; - * @return bool - */ - public function getBoolValue() - { - return $this->readOneof(2); - } - - public function hasBoolValue() - { - return $this->hasOneof(2); - } - - /** - * Generated from protobuf field bool bool_value = 2; - * @param bool $var - * @return $this - */ - public function setBoolValue($var) - { - GPBUtil::checkBool($var); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Generated from protobuf field int64 int_value = 3; - * @return int|string - */ - public function getIntValue() - { - return $this->readOneof(3); - } - - public function hasIntValue() - { - return $this->hasOneof(3); - } - - /** - * Generated from protobuf field int64 int_value = 3; - * @param int|string $var - * @return $this - */ - public function setIntValue($var) - { - GPBUtil::checkInt64($var); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Generated from protobuf field float float_value = 4; - * @return float - */ - public function getFloatValue() - { - return $this->readOneof(4); - } - - public function hasFloatValue() - { - return $this->hasOneof(4); - } - - /** - * Generated from protobuf field float float_value = 4; - * @param float $var - * @return $this - */ - public function setFloatValue($var) - { - GPBUtil::checkFloat($var); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Generated from protobuf field string string_value = 5; + * Generated from protobuf field string value = 2; * @return string */ - public function getStringValue() - { - return $this->readOneof(5); - } - - public function hasStringValue() + public function getValue() { - return $this->hasOneof(5); + return $this->value; } /** - * Generated from protobuf field string string_value = 5; + * Generated from protobuf field string value = 2; * @param string $var * @return $this */ - public function setStringValue($var) + public function setValue($var) { GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); + $this->value = $var; return $this; } - /** - * @return string - */ - public function getValue() - { - return $this->whichOneof("value"); - } - } // Adding a class alias for backwards compatibility with the previous class name. diff --git a/php/GamingPlatform/Api/GPBMetadata/Common/V1/Messaging.php b/php/GamingPlatform/Api/GPBMetadata/Common/V1/Messaging.php index 28f9bbc1668a7385b5c9641246670522c388dcf9..0c52080992f1b1677e54fd8cf81eb5c322a6eab5 100644 GIT binary patch delta 57 zcmV-90LK6G2%iYB%vwGRZSOn{3Jy!_>(%c`{QEW6fj*W~n3*F0Q2f{G9l* z#GKMp2_^+b4Gs?mAz?1g%)An)ATv;q87L^q#hsRup9m9X0SYq#g~hmdic5+z^U|Tp VS%Ko59t=+GT&!S2Cwnko2LQd+C1n5r diff --git a/schema/gamingplatform/api/common/v1/messaging.proto b/schema/gamingplatform/api/common/v1/messaging.proto index 70cb94b..40d0e2b 100644 --- a/schema/gamingplatform/api/common/v1/messaging.proto +++ b/schema/gamingplatform/api/common/v1/messaging.proto @@ -10,7 +10,7 @@ message ErrorResponse { message Violation { message Parameter { string name = 1; - oneof value {bool bool_value = 2; int64 int_value = 3; float float_value = 4; string string_value = 5;} + string value = 2; } string property_path = 1; string identifier = 2;