Esempio n. 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (datasetMetadataCase_ == DatasetMetadataOneofCase.TranslationDatasetMetadata)
            {
                hash ^= TranslationDatasetMetadata.GetHashCode();
            }
            if (datasetMetadataCase_ == DatasetMetadataOneofCase.ImageClassificationDatasetMetadata)
            {
                hash ^= ImageClassificationDatasetMetadata.GetHashCode();
            }
            if (datasetMetadataCase_ == DatasetMetadataOneofCase.TextClassificationDatasetMetadata)
            {
                hash ^= TextClassificationDatasetMetadata.GetHashCode();
            }
            if (datasetMetadataCase_ == DatasetMetadataOneofCase.ImageObjectDetectionDatasetMetadata)
            {
                hash ^= ImageObjectDetectionDatasetMetadata.GetHashCode();
            }
            if (datasetMetadataCase_ == DatasetMetadataOneofCase.TextExtractionDatasetMetadata)
            {
                hash ^= TextExtractionDatasetMetadata.GetHashCode();
            }
            if (datasetMetadataCase_ == DatasetMetadataOneofCase.TextSentimentDatasetMetadata)
            {
                hash ^= TextSentimentDatasetMetadata.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (DisplayName.Length != 0)
            {
                hash ^= DisplayName.GetHashCode();
            }
            if (Description.Length != 0)
            {
                hash ^= Description.GetHashCode();
            }
            if (ExampleCount != 0)
            {
                hash ^= ExampleCount.GetHashCode();
            }
            if (createTime_ != null)
            {
                hash ^= CreateTime.GetHashCode();
            }
            if (Etag.Length != 0)
            {
                hash ^= Etag.GetHashCode();
            }
            hash ^= Labels.GetHashCode();
            hash ^= (int)datasetMetadataCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 2
0
        public void MergeFrom(Dataset other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Name.Length != 0)
            {
                Name = other.Name;
            }
            if (other.DisplayName.Length != 0)
            {
                DisplayName = other.DisplayName;
            }
            if (other.Description.Length != 0)
            {
                Description = other.Description;
            }
            if (other.ExampleCount != 0)
            {
                ExampleCount = other.ExampleCount;
            }
            if (other.createTime_ != null)
            {
                if (createTime_ == null)
                {
                    CreateTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
                }
                CreateTime.MergeFrom(other.CreateTime);
            }
            if (other.Etag.Length != 0)
            {
                Etag = other.Etag;
            }
            labels_.Add(other.labels_);
            switch (other.DatasetMetadataCase)
            {
            case DatasetMetadataOneofCase.TranslationDatasetMetadata:
                if (TranslationDatasetMetadata == null)
                {
                    TranslationDatasetMetadata = new global::Google.Cloud.AutoML.V1.TranslationDatasetMetadata();
                }
                TranslationDatasetMetadata.MergeFrom(other.TranslationDatasetMetadata);
                break;

            case DatasetMetadataOneofCase.ImageClassificationDatasetMetadata:
                if (ImageClassificationDatasetMetadata == null)
                {
                    ImageClassificationDatasetMetadata = new global::Google.Cloud.AutoML.V1.ImageClassificationDatasetMetadata();
                }
                ImageClassificationDatasetMetadata.MergeFrom(other.ImageClassificationDatasetMetadata);
                break;

            case DatasetMetadataOneofCase.TextClassificationDatasetMetadata:
                if (TextClassificationDatasetMetadata == null)
                {
                    TextClassificationDatasetMetadata = new global::Google.Cloud.AutoML.V1.TextClassificationDatasetMetadata();
                }
                TextClassificationDatasetMetadata.MergeFrom(other.TextClassificationDatasetMetadata);
                break;

            case DatasetMetadataOneofCase.ImageObjectDetectionDatasetMetadata:
                if (ImageObjectDetectionDatasetMetadata == null)
                {
                    ImageObjectDetectionDatasetMetadata = new global::Google.Cloud.AutoML.V1.ImageObjectDetectionDatasetMetadata();
                }
                ImageObjectDetectionDatasetMetadata.MergeFrom(other.ImageObjectDetectionDatasetMetadata);
                break;

            case DatasetMetadataOneofCase.TextExtractionDatasetMetadata:
                if (TextExtractionDatasetMetadata == null)
                {
                    TextExtractionDatasetMetadata = new global::Google.Cloud.AutoML.V1.TextExtractionDatasetMetadata();
                }
                TextExtractionDatasetMetadata.MergeFrom(other.TextExtractionDatasetMetadata);
                break;

            case DatasetMetadataOneofCase.TextSentimentDatasetMetadata:
                if (TextSentimentDatasetMetadata == null)
                {
                    TextSentimentDatasetMetadata = new global::Google.Cloud.AutoML.V1.TextSentimentDatasetMetadata();
                }
                TextSentimentDatasetMetadata.MergeFrom(other.TextSentimentDatasetMetadata);
                break;
            }

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