Пример #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.Cloud.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.Cloud.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.Cloud.Logging.V2.LogEntryOperation();
                    }
                    input.ReadMessage(operation_);
                    break;
                }

                case 178: {
                    Trace = input.ReadString();
                    break;
                }

                case 186: {
                    if (sourceLocation_ == null)
                    {
                        sourceLocation_ = new global::Google.Cloud.Logging.V2.LogEntrySourceLocation();
                    }
                    input.ReadMessage(sourceLocation_);
                    break;
                }
                }
            }
        }
Пример #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 != 0)
            {
                Severity = other.Severity;
            }
            if (other.InsertId.Length != 0)
            {
                InsertId = other.InsertId;
            }
            if (other.httpRequest_ != null)
            {
                if (httpRequest_ == null)
                {
                    httpRequest_ = new global::Google.Cloud.Logging.Type.HttpRequest();
                }
                HttpRequest.MergeFrom(other.HttpRequest);
            }
            labels_.Add(other.labels_);
            if (other.operation_ != null)
            {
                if (operation_ == null)
                {
                    operation_ = new global::Google.Cloud.Logging.V2.LogEntryOperation();
                }
                Operation.MergeFrom(other.Operation);
            }
            if (other.Trace.Length != 0)
            {
                Trace = other.Trace;
            }
            if (other.sourceLocation_ != null)
            {
                if (sourceLocation_ == null)
                {
                    sourceLocation_ = new global::Google.Cloud.Logging.V2.LogEntrySourceLocation();
                }
                SourceLocation.MergeFrom(other.SourceLocation);
            }
            switch (other.PayloadCase)
            {
            case PayloadOneofCase.ProtoPayload:
                ProtoPayload = other.ProtoPayload;
                break;

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

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