Esempio n. 1
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);
        }
Esempio n. 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (FolderId.Length != 0)
            {
                hash ^= FolderId.GetHashCode();
            }
            if (createdAt_ != null)
            {
                hash ^= CreatedAt.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Description.Length != 0)
            {
                hash ^= Description.GetHashCode();
            }
            hash ^= Labels.GetHashCode();
            if (TypeId.Length != 0)
            {
                hash ^= TypeId.GetHashCode();
            }
            if (ZoneId.Length != 0)
            {
                hash ^= ZoneId.GetHashCode();
            }
            if (Size != 0L)
            {
                hash ^= Size.GetHashCode();
            }
            if (BlockSize != 0L)
            {
                hash ^= BlockSize.GetHashCode();
            }
            hash ^= productIds_.GetHashCode();
            if (Status != global::Yandex.Cloud.Compute.V1.Disk.Types.Status.Unspecified)
            {
                hash ^= Status.GetHashCode();
            }
            if (sourceCase_ == SourceOneofCase.SourceImageId)
            {
                hash ^= SourceImageId.GetHashCode();
            }
            if (sourceCase_ == SourceOneofCase.SourceSnapshotId)
            {
                hash ^= SourceSnapshotId.GetHashCode();
            }
            hash ^= instanceIds_.GetHashCode();
            if (diskPlacementPolicy_ != null)
            {
                hash ^= DiskPlacementPolicy.GetHashCode();
            }
            hash ^= (int)sourceCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }