Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MergeMessageFrom() #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function MergeFrom(\Protobuf\Internal\Decoder $d): void {
$d->skip($fn, $wt);
}
}
$this->XXX_unrecognized = $d->skippedRaw();
$this->XXX_unrecognized .= $d->skippedRaw();
}

public function WriteTo(\Protobuf\Internal\Encoder $e): void {
Expand Down Expand Up @@ -149,6 +149,17 @@ public function CopyFrom(\Protobuf\Message $o): \Errors\Error {
$this->XXX_unrecognized = $o->XXX_unrecognized;
return \Errors\Ok();
}

public function MergeMessageFrom(\Protobuf\Message $o): \Errors\Error {
if (!($o is FailureSet)) {
return \Errors\Errorf('MergeMessageFrom failed: incorrect type received: %s', $o->MessageName());
}
foreach ($o->failure as $v) {
$this->failure []= $v;
}
$this->XXX_unrecognized .= $o->XXX_unrecognized;
return \Errors\Ok();
}
}

enum ConformanceRequest_payload_oneof_t: int {
Expand Down Expand Up @@ -337,7 +348,7 @@ public function MergeFrom(\Protobuf\Internal\Decoder $d): void {
$d->skip($fn, $wt);
}
}
$this->XXX_unrecognized = $d->skippedRaw();
$this->XXX_unrecognized .= $d->skippedRaw();
}

public function WriteTo(\Protobuf\Internal\Encoder $e): void {
Expand Down Expand Up @@ -434,6 +445,37 @@ public function CopyFrom(\Protobuf\Message $o): \Errors\Error {
$this->XXX_unrecognized = $o->XXX_unrecognized;
return \Errors\Ok();
}

public function MergeMessageFrom(\Protobuf\Message $o): \Errors\Error {
if (!($o is ConformanceRequest)) {
return \Errors\Errorf('MergeMessageFrom failed: incorrect type received: %s', $o->MessageName());
}
if ($o->requested_output_format !== \conformance\WireFormat::FromInt(0)) {
$this->requested_output_format = $o->requested_output_format;
}
if ($o->message_type !== '') {
$this->message_type = $o->message_type;
}
if ($o->test_category !== \conformance\TestCategory::FromInt(0)) {
$this->test_category = $o->test_category;
}
if ($o->jspb_encoding_options !== null) {
if ($this->jspb_encoding_options !== null) {
$this->jspb_encoding_options->MergeMessageFrom($o->jspb_encoding_options);
} else {
$this->jspb_encoding_options = new \conformance\JspbEncodingConfig();
$this->jspb_encoding_options->CopyFrom($o);
}
}
if ($o->print_unknown_fields !== false) {
$this->print_unknown_fields = $o->print_unknown_fields;
}
if ($o->payload->WhichOneof() !== ConformanceRequest_payload_oneof_t::NOT_SET) {
$this->payload = $o->payload->Copy();
}
$this->XXX_unrecognized .= $o->XXX_unrecognized;
return \Errors\Ok();
}
}

enum ConformanceResponse_result_oneof_t: int {
Expand Down Expand Up @@ -691,7 +733,7 @@ public function MergeFrom(\Protobuf\Internal\Decoder $d): void {
$d->skip($fn, $wt);
}
}
$this->XXX_unrecognized = $d->skippedRaw();
$this->XXX_unrecognized .= $d->skippedRaw();
}

public function WriteTo(\Protobuf\Internal\Encoder $e): void {
Expand Down Expand Up @@ -746,6 +788,17 @@ public function CopyFrom(\Protobuf\Message $o): \Errors\Error {
$this->XXX_unrecognized = $o->XXX_unrecognized;
return \Errors\Ok();
}

public function MergeMessageFrom(\Protobuf\Message $o): \Errors\Error {
if (!($o is ConformanceResponse)) {
return \Errors\Errorf('MergeMessageFrom failed: incorrect type received: %s', $o->MessageName());
}
if ($o->result->WhichOneof() !== ConformanceResponse_result_oneof_t::NOT_SET) {
$this->result = $o->result->Copy();
}
$this->XXX_unrecognized .= $o->XXX_unrecognized;
return \Errors\Ok();
}
}

class JspbEncodingConfig implements \Protobuf\Message {
Expand Down Expand Up @@ -783,7 +836,7 @@ public function MergeFrom(\Protobuf\Internal\Decoder $d): void {
$d->skip($fn, $wt);
}
}
$this->XXX_unrecognized = $d->skippedRaw();
$this->XXX_unrecognized .= $d->skippedRaw();
}

public function WriteTo(\Protobuf\Internal\Encoder $e): void {
Expand Down Expand Up @@ -820,6 +873,17 @@ public function CopyFrom(\Protobuf\Message $o): \Errors\Error {
$this->XXX_unrecognized = $o->XXX_unrecognized;
return \Errors\Ok();
}

public function MergeMessageFrom(\Protobuf\Message $o): \Errors\Error {
if (!($o is JspbEncodingConfig)) {
return \Errors\Errorf('MergeMessageFrom failed: incorrect type received: %s', $o->MessageName());
}
if ($o->use_jspb_array_any_format !== false) {
$this->use_jspb_array_any_format = $o->use_jspb_array_any_format;
}
$this->XXX_unrecognized .= $o->XXX_unrecognized;
return \Errors\Ok();
}
}


Expand Down
16 changes: 15 additions & 1 deletion generated/google/protobuf/any_proto.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function MergeFrom(\Protobuf\Internal\Decoder $d): void {
$d->skip($fn, $wt);
}
}
$this->XXX_unrecognized = $d->skippedRaw();
$this->XXX_unrecognized .= $d->skippedRaw();
}

public function WriteTo(\Protobuf\Internal\Encoder $e): void {
Expand Down Expand Up @@ -91,6 +91,20 @@ public function CopyFrom(\Protobuf\Message $o): \Errors\Error {
$this->XXX_unrecognized = $o->XXX_unrecognized;
return \Errors\Ok();
}

public function MergeMessageFrom(\Protobuf\Message $o): \Errors\Error {
if (!($o is Any)) {
return \Errors\Errorf('MergeMessageFrom failed: incorrect type received: %s', $o->MessageName());
}
if ($o->type_url !== '') {
$this->type_url = $o->type_url;
}
if ($o->value !== '') {
$this->value = $o->value;
}
$this->XXX_unrecognized .= $o->XXX_unrecognized;
return \Errors\Ok();
}
}


Expand Down
91 changes: 88 additions & 3 deletions generated/google/protobuf/api_proto.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function MergeFrom(\Protobuf\Internal\Decoder $d): void {
$d->skip($fn, $wt);
}
}
$this->XXX_unrecognized = $d->skippedRaw();
$this->XXX_unrecognized .= $d->skippedRaw();
}

public function WriteTo(\Protobuf\Internal\Encoder $e): void {
Expand Down Expand Up @@ -209,6 +209,46 @@ public function CopyFrom(\Protobuf\Message $o): \Errors\Error {
$this->XXX_unrecognized = $o->XXX_unrecognized;
return \Errors\Ok();
}

public function MergeMessageFrom(\Protobuf\Message $o): \Errors\Error {
if (!($o is Api)) {
return \Errors\Errorf('MergeMessageFrom failed: incorrect type received: %s', $o->MessageName());
}
if ($o->name !== '') {
$this->name = $o->name;
}
foreach ($o->methods as $v) {
$vc = new \google\protobuf\Method();
$vc->CopyFrom($v);
$this->methods []= $vc;
}
foreach ($o->options as $v) {
$vc = new \google\protobuf\Option();
$vc->CopyFrom($v);
$this->options []= $vc;
}
if ($o->version !== '') {
$this->version = $o->version;
}
if ($o->source_context !== null) {
if ($this->source_context !== null) {
$this->source_context->MergeMessageFrom($o->source_context);
} else {
$this->source_context = new \google\protobuf\SourceContext();
$this->source_context->CopyFrom($o);
}
}
foreach ($o->mixins as $v) {
$vc = new \google\protobuf\Mixin();
$vc->CopyFrom($v);
$this->mixins []= $vc;
}
if ($o->syntax !== \google\protobuf\Syntax::FromInt(0)) {
$this->syntax = $o->syntax;
}
$this->XXX_unrecognized .= $o->XXX_unrecognized;
return \Errors\Ok();
}
}

class Method implements \Protobuf\Message {
Expand Down Expand Up @@ -284,7 +324,7 @@ public function MergeFrom(\Protobuf\Internal\Decoder $d): void {
$d->skip($fn, $wt);
}
}
$this->XXX_unrecognized = $d->skippedRaw();
$this->XXX_unrecognized .= $d->skippedRaw();
}

public function WriteTo(\Protobuf\Internal\Encoder $e): void {
Expand Down Expand Up @@ -384,6 +424,37 @@ public function CopyFrom(\Protobuf\Message $o): \Errors\Error {
$this->XXX_unrecognized = $o->XXX_unrecognized;
return \Errors\Ok();
}

public function MergeMessageFrom(\Protobuf\Message $o): \Errors\Error {
if (!($o is Method)) {
return \Errors\Errorf('MergeMessageFrom failed: incorrect type received: %s', $o->MessageName());
}
if ($o->name !== '') {
$this->name = $o->name;
}
if ($o->request_type_url !== '') {
$this->request_type_url = $o->request_type_url;
}
if ($o->request_streaming !== false) {
$this->request_streaming = $o->request_streaming;
}
if ($o->response_type_url !== '') {
$this->response_type_url = $o->response_type_url;
}
if ($o->response_streaming !== false) {
$this->response_streaming = $o->response_streaming;
}
foreach ($o->options as $v) {
$vc = new \google\protobuf\Option();
$vc->CopyFrom($v);
$this->options []= $vc;
}
if ($o->syntax !== \google\protobuf\Syntax::FromInt(0)) {
$this->syntax = $o->syntax;
}
$this->XXX_unrecognized .= $o->XXX_unrecognized;
return \Errors\Ok();
}
}

class Mixin implements \Protobuf\Message {
Expand Down Expand Up @@ -427,7 +498,7 @@ public function MergeFrom(\Protobuf\Internal\Decoder $d): void {
$d->skip($fn, $wt);
}
}
$this->XXX_unrecognized = $d->skippedRaw();
$this->XXX_unrecognized .= $d->skippedRaw();
}

public function WriteTo(\Protobuf\Internal\Encoder $e): void {
Expand Down Expand Up @@ -473,6 +544,20 @@ public function CopyFrom(\Protobuf\Message $o): \Errors\Error {
$this->XXX_unrecognized = $o->XXX_unrecognized;
return \Errors\Ok();
}

public function MergeMessageFrom(\Protobuf\Message $o): \Errors\Error {
if (!($o is Mixin)) {
return \Errors\Errorf('MergeMessageFrom failed: incorrect type received: %s', $o->MessageName());
}
if ($o->name !== '') {
$this->name = $o->name;
}
if ($o->root !== '') {
$this->root = $o->root;
}
$this->XXX_unrecognized .= $o->XXX_unrecognized;
return \Errors\Ok();
}
}


Expand Down
Loading