Ejemplo n.º 1
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    input.SkipLastField();
                    break;

                case 18: {
                    global::Google.Protobuf.WellKnownTypes.Any subBuilder = new global::Google.Protobuf.WellKnownTypes.Any();
                    if (payloadCase_ == PayloadOneofCase.ProtoPayload)
                    {
                        subBuilder.MergeFrom(ProtoPayload);
                    }
                    input.ReadMessage(subBuilder);
                    ProtoPayload = subBuilder;
                    break;
                }

                case 26: {
                    TextPayload = input.ReadString();
                    break;
                }

                case 34: {
                    InsertId = input.ReadString();
                    break;
                }

                case 50: {
                    global::Google.Protobuf.WellKnownTypes.Struct subBuilder = new global::Google.Protobuf.WellKnownTypes.Struct();
                    if (payloadCase_ == PayloadOneofCase.JsonPayload)
                    {
                        subBuilder.MergeFrom(JsonPayload);
                    }
                    input.ReadMessage(subBuilder);
                    JsonPayload = subBuilder;
                    break;
                }

                case 58: {
                    if (httpRequest_ == null)
                    {
                        httpRequest_ = new global::Google.Logging.Type.HttpRequest();
                    }
                    input.ReadMessage(httpRequest_);
                    break;
                }

                case 66: {
                    if (resource_ == null)
                    {
                        resource_ = new global::Google.Api.MonitoredResource();
                    }
                    input.ReadMessage(resource_);
                    break;
                }

                case 74: {
                    if (timestamp_ == null)
                    {
                        timestamp_ = new global::Google.Protobuf.WellKnownTypes.Timestamp();
                    }
                    input.ReadMessage(timestamp_);
                    break;
                }

                case 80: {
                    severity_ = (global::Google.Logging.Type.LogSeverity)input.ReadEnum();
                    break;
                }

                case 90: {
                    labels_.AddEntriesFrom(input, _map_labels_codec);
                    break;
                }

                case 98: {
                    LogName = input.ReadString();
                    break;
                }

                case 122: {
                    if (operation_ == null)
                    {
                        operation_ = new global::Google.Logging.V2.LogEntryOperation();
                    }
                    input.ReadMessage(operation_);
                    break;
                }
                }
            }
        }
Ejemplo n.º 2
0
        public void MergeFrom(LogEntry other)
        {
            if (other == null)
            {
                return;
            }
            if (other.LogName.Length != 0)
            {
                LogName = other.LogName;
            }
            if (other.resource_ != null)
            {
                if (resource_ == null)
                {
                    resource_ = new global::Google.Api.MonitoredResource();
                }
                Resource.MergeFrom(other.Resource);
            }
            if (other.timestamp_ != null)
            {
                if (timestamp_ == null)
                {
                    timestamp_ = new global::Google.Protobuf.WellKnownTypes.Timestamp();
                }
                Timestamp.MergeFrom(other.Timestamp);
            }
            if (other.Severity != global::Google.Logging.Type.LogSeverity.DEFAULT)
            {
                Severity = other.Severity;
            }
            if (other.InsertId.Length != 0)
            {
                InsertId = other.InsertId;
            }
            if (other.httpRequest_ != null)
            {
                if (httpRequest_ == null)
                {
                    httpRequest_ = new global::Google.Logging.Type.HttpRequest();
                }
                HttpRequest.MergeFrom(other.HttpRequest);
            }
            labels_.Add(other.labels_);
            if (other.operation_ != null)
            {
                if (operation_ == null)
                {
                    operation_ = new global::Google.Logging.V2.LogEntryOperation();
                }
                Operation.MergeFrom(other.Operation);
            }
            switch (other.PayloadCase)
            {
            case PayloadOneofCase.ProtoPayload:
                ProtoPayload = other.ProtoPayload;
                break;

            case PayloadOneofCase.TextPayload:
                TextPayload = other.TextPayload;
                break;

            case PayloadOneofCase.JsonPayload:
                JsonPayload = other.JsonPayload;
                break;
            }
        }