Exemple #1
0
        public void MergeFrom(pb::CodedInputStream input)
        {
    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
            input.ReadRawMessage(this);
    #else
            uint tag;
            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 10: {
                    AnnotationSpecId = input.ReadString();
                    break;
                }

                case 18: {
                    global::Google.Cloud.Automl.V1Beta1.TranslationAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.TranslationAnnotation();
                    if (detailCase_ == DetailOneofCase.Translation)
                    {
                        subBuilder.MergeFrom(Translation);
                    }
                    input.ReadMessage(subBuilder);
                    Translation = subBuilder;
                    break;
                }

                case 26: {
                    global::Google.Cloud.Automl.V1Beta1.ClassificationAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.ClassificationAnnotation();
                    if (detailCase_ == DetailOneofCase.Classification)
                    {
                        subBuilder.MergeFrom(Classification);
                    }
                    input.ReadMessage(subBuilder);
                    Classification = subBuilder;
                    break;
                }

                case 34: {
                    global::Google.Cloud.Automl.V1Beta1.ImageObjectDetectionAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.ImageObjectDetectionAnnotation();
                    if (detailCase_ == DetailOneofCase.ImageObjectDetection)
                    {
                        subBuilder.MergeFrom(ImageObjectDetection);
                    }
                    input.ReadMessage(subBuilder);
                    ImageObjectDetection = subBuilder;
                    break;
                }

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

                case 50: {
                    global::Google.Cloud.Automl.V1Beta1.TextExtractionAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.TextExtractionAnnotation();
                    if (detailCase_ == DetailOneofCase.TextExtraction)
                    {
                        subBuilder.MergeFrom(TextExtraction);
                    }
                    input.ReadMessage(subBuilder);
                    TextExtraction = subBuilder;
                    break;
                }

                case 58: {
                    global::Google.Cloud.Automl.V1Beta1.TextSentimentAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.TextSentimentAnnotation();
                    if (detailCase_ == DetailOneofCase.TextSentiment)
                    {
                        subBuilder.MergeFrom(TextSentiment);
                    }
                    input.ReadMessage(subBuilder);
                    TextSentiment = subBuilder;
                    break;
                }

                case 66: {
                    global::Google.Cloud.Automl.V1Beta1.VideoObjectTrackingAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.VideoObjectTrackingAnnotation();
                    if (detailCase_ == DetailOneofCase.VideoObjectTracking)
                    {
                        subBuilder.MergeFrom(VideoObjectTracking);
                    }
                    input.ReadMessage(subBuilder);
                    VideoObjectTracking = subBuilder;
                    break;
                }

                case 74: {
                    global::Google.Cloud.Automl.V1Beta1.VideoClassificationAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.VideoClassificationAnnotation();
                    if (detailCase_ == DetailOneofCase.VideoClassification)
                    {
                        subBuilder.MergeFrom(VideoClassification);
                    }
                    input.ReadMessage(subBuilder);
                    VideoClassification = subBuilder;
                    break;
                }

                case 82: {
                    global::Google.Cloud.Automl.V1Beta1.TablesAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.TablesAnnotation();
                    if (detailCase_ == DetailOneofCase.Tables)
                    {
                        subBuilder.MergeFrom(Tables);
                    }
                    input.ReadMessage(subBuilder);
                    Tables = subBuilder;
                    break;
                }
                }
            }
    #endif
        }
Exemple #2
0
        void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
                    break;

                case 10: {
                    AnnotationSpecId = input.ReadString();
                    break;
                }

                case 18: {
                    global::Google.Cloud.Automl.V1Beta1.TranslationAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.TranslationAnnotation();
                    if (detailCase_ == DetailOneofCase.Translation)
                    {
                        subBuilder.MergeFrom(Translation);
                    }
                    input.ReadMessage(subBuilder);
                    Translation = subBuilder;
                    break;
                }

                case 26: {
                    global::Google.Cloud.Automl.V1Beta1.ClassificationAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.ClassificationAnnotation();
                    if (detailCase_ == DetailOneofCase.Classification)
                    {
                        subBuilder.MergeFrom(Classification);
                    }
                    input.ReadMessage(subBuilder);
                    Classification = subBuilder;
                    break;
                }

                case 34: {
                    global::Google.Cloud.Automl.V1Beta1.ImageObjectDetectionAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.ImageObjectDetectionAnnotation();
                    if (detailCase_ == DetailOneofCase.ImageObjectDetection)
                    {
                        subBuilder.MergeFrom(ImageObjectDetection);
                    }
                    input.ReadMessage(subBuilder);
                    ImageObjectDetection = subBuilder;
                    break;
                }

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

                case 50: {
                    global::Google.Cloud.Automl.V1Beta1.TextExtractionAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.TextExtractionAnnotation();
                    if (detailCase_ == DetailOneofCase.TextExtraction)
                    {
                        subBuilder.MergeFrom(TextExtraction);
                    }
                    input.ReadMessage(subBuilder);
                    TextExtraction = subBuilder;
                    break;
                }

                case 58: {
                    global::Google.Cloud.Automl.V1Beta1.TextSentimentAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.TextSentimentAnnotation();
                    if (detailCase_ == DetailOneofCase.TextSentiment)
                    {
                        subBuilder.MergeFrom(TextSentiment);
                    }
                    input.ReadMessage(subBuilder);
                    TextSentiment = subBuilder;
                    break;
                }

                case 66: {
                    global::Google.Cloud.Automl.V1Beta1.VideoObjectTrackingAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.VideoObjectTrackingAnnotation();
                    if (detailCase_ == DetailOneofCase.VideoObjectTracking)
                    {
                        subBuilder.MergeFrom(VideoObjectTracking);
                    }
                    input.ReadMessage(subBuilder);
                    VideoObjectTracking = subBuilder;
                    break;
                }

                case 74: {
                    global::Google.Cloud.Automl.V1Beta1.VideoClassificationAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.VideoClassificationAnnotation();
                    if (detailCase_ == DetailOneofCase.VideoClassification)
                    {
                        subBuilder.MergeFrom(VideoClassification);
                    }
                    input.ReadMessage(subBuilder);
                    VideoClassification = subBuilder;
                    break;
                }

                case 82: {
                    global::Google.Cloud.Automl.V1Beta1.TablesAnnotation subBuilder = new global::Google.Cloud.Automl.V1Beta1.TablesAnnotation();
                    if (detailCase_ == DetailOneofCase.Tables)
                    {
                        subBuilder.MergeFrom(Tables);
                    }
                    input.ReadMessage(subBuilder);
                    Tables = subBuilder;
                    break;
                }
                }
            }
        }
Exemple #3
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);
        }