Example #1
0
        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: {
                    Id = input.ReadString();
                    break;
                }

                case 18: {
                    FolderId = input.ReadString();
                    break;
                }

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

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

                case 42: {
                    Description = input.ReadString();
                    break;
                }

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

                case 58: {
                    TypeId = input.ReadString();
                    break;
                }

                case 66: {
                    ZoneId = input.ReadString();
                    break;
                }

                case 72: {
                    Size = input.ReadInt64();
                    break;
                }

                case 82: {
                    productIds_.AddEntriesFrom(input, _repeated_productIds_codec);
                    break;
                }

                case 88: {
                    Status = (global::Yandex.Cloud.Compute.V1.Disk.Types.Status)input.ReadEnum();
                    break;
                }

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

                case 106: {
                    SourceSnapshotId = input.ReadString();
                    break;
                }

                case 114: {
                    instanceIds_.AddEntriesFrom(input, _repeated_instanceIds_codec);
                    break;
                }

                case 120: {
                    BlockSize = input.ReadInt64();
                    break;
                }

                case 130: {
                    if (diskPlacementPolicy_ == null)
                    {
                        DiskPlacementPolicy = new global::Yandex.Cloud.Compute.V1.DiskPlacementPolicy();
                    }
                    input.ReadMessage(DiskPlacementPolicy);
                    break;
                }
                }
            }
        }
Example #2
0
        public void MergeFrom(Disk other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Id.Length != 0)
            {
                Id = other.Id;
            }
            if (other.FolderId.Length != 0)
            {
                FolderId = other.FolderId;
            }
            if (other.createdAt_ != null)
            {
                if (createdAt_ == null)
                {
                    CreatedAt = new global::Google.Protobuf.WellKnownTypes.Timestamp();
                }
                CreatedAt.MergeFrom(other.CreatedAt);
            }
            if (other.Name.Length != 0)
            {
                Name = other.Name;
            }
            if (other.Description.Length != 0)
            {
                Description = other.Description;
            }
            labels_.Add(other.labels_);
            if (other.TypeId.Length != 0)
            {
                TypeId = other.TypeId;
            }
            if (other.ZoneId.Length != 0)
            {
                ZoneId = other.ZoneId;
            }
            if (other.Size != 0L)
            {
                Size = other.Size;
            }
            if (other.BlockSize != 0L)
            {
                BlockSize = other.BlockSize;
            }
            productIds_.Add(other.productIds_);
            if (other.Status != global::Yandex.Cloud.Compute.V1.Disk.Types.Status.Unspecified)
            {
                Status = other.Status;
            }
            instanceIds_.Add(other.instanceIds_);
            if (other.diskPlacementPolicy_ != null)
            {
                if (diskPlacementPolicy_ == null)
                {
                    DiskPlacementPolicy = new global::Yandex.Cloud.Compute.V1.DiskPlacementPolicy();
                }
                DiskPlacementPolicy.MergeFrom(other.DiskPlacementPolicy);
            }
            switch (other.SourceCase)
            {
            case SourceOneofCase.SourceImageId:
                SourceImageId = other.SourceImageId;
                break;

            case SourceOneofCase.SourceSnapshotId:
                SourceSnapshotId = other.SourceSnapshotId;
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }