public void MergeFrom(MetricDescriptor other) { if (other == null) { return; } if (other.Name.Length != 0) { Name = other.Name; } if (other.Type.Length != 0) { Type = other.Type; } labels_.Add(other.labels_); if (other.MetricKind != global::Google.Api.MetricDescriptor.Types.MetricKind.Unspecified) { MetricKind = other.MetricKind; } if (other.ValueType != global::Google.Api.MetricDescriptor.Types.ValueType.Unspecified) { ValueType = other.ValueType; } if (other.Unit.Length != 0) { Unit = other.Unit; } if (other.Description.Length != 0) { Description = other.Description; } if (other.DisplayName.Length != 0) { DisplayName = other.DisplayName; } if (other.metadata_ != null) { if (metadata_ == null) { Metadata = new global::Google.Api.MetricDescriptor.Types.MetricDescriptorMetadata(); } Metadata.MergeFrom(other.Metadata); } if (other.LaunchStage != global::Google.Api.LaunchStage.Unspecified) { LaunchStage = other.LaunchStage; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch (tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Name = input.ReadString(); break; } case 18: { labels_.AddEntriesFrom(input, _repeated_labels_codec); break; } case 24: { MetricKind = (global::Google.Api.MetricDescriptor.Types.MetricKind)input.ReadEnum(); break; } case 32: { ValueType = (global::Google.Api.MetricDescriptor.Types.ValueType)input.ReadEnum(); break; } case 42: { Unit = input.ReadString(); break; } case 50: { Description = input.ReadString(); break; } case 58: { DisplayName = input.ReadString(); break; } case 66: { Type = input.ReadString(); break; } case 82: { if (metadata_ == null) { Metadata = new global::Google.Api.MetricDescriptor.Types.MetricDescriptorMetadata(); } input.ReadMessage(Metadata); break; } case 96: { LaunchStage = (global::Google.Api.LaunchStage)input.ReadEnum(); break; } } } }