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

            if (detailCase_ == DetailOneofCase.Translation)
            {
                hash ^= Translation.GetHashCode();
            }
            if (detailCase_ == DetailOneofCase.Classification)
            {
                hash ^= Classification.GetHashCode();
            }
            if (detailCase_ == DetailOneofCase.ImageObjectDetection)
            {
                hash ^= ImageObjectDetection.GetHashCode();
            }
            if (detailCase_ == DetailOneofCase.VideoClassification)
            {
                hash ^= VideoClassification.GetHashCode();
            }
            if (detailCase_ == DetailOneofCase.VideoObjectTracking)
            {
                hash ^= VideoObjectTracking.GetHashCode();
            }
            if (detailCase_ == DetailOneofCase.TextExtraction)
            {
                hash ^= TextExtraction.GetHashCode();
            }
            if (detailCase_ == DetailOneofCase.TextSentiment)
            {
                hash ^= TextSentiment.GetHashCode();
            }
            if (detailCase_ == DetailOneofCase.Tables)
            {
                hash ^= Tables.GetHashCode();
            }
            if (AnnotationSpecId.Length != 0)
            {
                hash ^= AnnotationSpecId.GetHashCode();
            }
            if (DisplayName.Length != 0)
            {
                hash ^= DisplayName.GetHashCode();
            }
            hash ^= (int)detailCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 2
0
        public void MergeFrom(AnnotationPayload other)
        {
            if (other == null)
            {
                return;
            }
            if (other.AnnotationSpecId.Length != 0)
            {
                AnnotationSpecId = other.AnnotationSpecId;
            }
            if (other.DisplayName.Length != 0)
            {
                DisplayName = other.DisplayName;
            }
            switch (other.DetailCase)
            {
            case DetailOneofCase.Translation:
                if (Translation == null)
                {
                    Translation = new global::Google.Cloud.Automl.V1Beta1.TranslationAnnotation();
                }
                Translation.MergeFrom(other.Translation);
                break;

            case DetailOneofCase.Classification:
                if (Classification == null)
                {
                    Classification = new global::Google.Cloud.Automl.V1Beta1.ClassificationAnnotation();
                }
                Classification.MergeFrom(other.Classification);
                break;

            case DetailOneofCase.ImageObjectDetection:
                if (ImageObjectDetection == null)
                {
                    ImageObjectDetection = new global::Google.Cloud.Automl.V1Beta1.ImageObjectDetectionAnnotation();
                }
                ImageObjectDetection.MergeFrom(other.ImageObjectDetection);
                break;

            case DetailOneofCase.VideoClassification:
                if (VideoClassification == null)
                {
                    VideoClassification = new global::Google.Cloud.Automl.V1Beta1.VideoClassificationAnnotation();
                }
                VideoClassification.MergeFrom(other.VideoClassification);
                break;

            case DetailOneofCase.VideoObjectTracking:
                if (VideoObjectTracking == null)
                {
                    VideoObjectTracking = new global::Google.Cloud.Automl.V1Beta1.VideoObjectTrackingAnnotation();
                }
                VideoObjectTracking.MergeFrom(other.VideoObjectTracking);
                break;

            case DetailOneofCase.TextExtraction:
                if (TextExtraction == null)
                {
                    TextExtraction = new global::Google.Cloud.Automl.V1Beta1.TextExtractionAnnotation();
                }
                TextExtraction.MergeFrom(other.TextExtraction);
                break;

            case DetailOneofCase.TextSentiment:
                if (TextSentiment == null)
                {
                    TextSentiment = new global::Google.Cloud.Automl.V1Beta1.TextSentimentAnnotation();
                }
                TextSentiment.MergeFrom(other.TextSentiment);
                break;

            case DetailOneofCase.Tables:
                if (Tables == null)
                {
                    Tables = new global::Google.Cloud.Automl.V1Beta1.TablesAnnotation();
                }
                Tables.MergeFrom(other.Tables);
                break;
            }

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