public void MergeFrom(CryptoKey other) { if (other == null) { return; } if (other.Name.Length != 0) { Name = other.Name; } if (other.primary_ != null) { if (primary_ == null) { primary_ = new global::Google.Cloud.Kms.V1.CryptoKeyVersion(); } Primary.MergeFrom(other.Primary); } if (other.Purpose != 0) { Purpose = other.Purpose; } if (other.createTime_ != null) { if (createTime_ == null) { createTime_ = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } CreateTime.MergeFrom(other.CreateTime); } if (other.nextRotationTime_ != null) { if (nextRotationTime_ == null) { nextRotationTime_ = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } NextRotationTime.MergeFrom(other.NextRotationTime); } labels_.Add(other.labels_); switch (other.RotationScheduleCase) { case RotationScheduleOneofCase.RotationPeriod: if (RotationPeriod == null) { RotationPeriod = new global::Google.Protobuf.WellKnownTypes.Duration(); } RotationPeriod.MergeFrom(other.RotationPeriod); break; } _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: { if (primary_ == null) { primary_ = new global::Google.Cloud.Kms.V1.CryptoKeyVersion(); } input.ReadMessage(primary_); break; } case 24: { purpose_ = (global::Google.Cloud.Kms.V1.CryptoKey.Types.CryptoKeyPurpose)input.ReadEnum(); break; } case 42: { if (createTime_ == null) { createTime_ = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(createTime_); break; } case 58: { if (nextRotationTime_ == null) { nextRotationTime_ = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(nextRotationTime_); break; } case 66: { global::Google.Protobuf.WellKnownTypes.Duration subBuilder = new global::Google.Protobuf.WellKnownTypes.Duration(); if (rotationScheduleCase_ == RotationScheduleOneofCase.RotationPeriod) { subBuilder.MergeFrom(RotationPeriod); } input.ReadMessage(subBuilder); RotationPeriod = subBuilder; break; } case 82: { labels_.AddEntriesFrom(input, _map_labels_codec); break; } } } }