public void MergeFrom(Model other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Name.Length != 0)
            {
                Name = other.Name;
            }
            if (other.DisplayName.Length != 0)
            {
                DisplayName = other.DisplayName;
            }
            if (other.DatasetId.Length != 0)
            {
                DatasetId = other.DatasetId;
            }
            if (other.createTime_ != null)
            {
                if (createTime_ == null)
                {
                    CreateTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
                }
                CreateTime.MergeFrom(other.CreateTime);
            }
            if (other.updateTime_ != null)
            {
                if (updateTime_ == null)
                {
                    UpdateTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
                }
                UpdateTime.MergeFrom(other.UpdateTime);
            }
            if (other.DeploymentState != 0)
            {
                DeploymentState = other.DeploymentState;
            }
            labels_.Add(other.labels_);
            switch (other.ModelMetadataCase)
            {
            case ModelMetadataOneofCase.TranslationModelMetadata:
                if (TranslationModelMetadata == null)
                {
                    TranslationModelMetadata = new global::Google.Cloud.AutoML.V1.TranslationModelMetadata();
                }
                TranslationModelMetadata.MergeFrom(other.TranslationModelMetadata);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Exemple #2
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: {
                    Name = input.ReadString();
                    break;
                }

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

                case 26: {
                    DatasetId = input.ReadString();
                    break;
                }

                case 58: {
                    if (createTime_ == null)
                    {
                        CreateTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
                    }
                    input.ReadMessage(CreateTime);
                    break;
                }

                case 64: {
                    DeploymentState = (global::Google.Cloud.AutoML.V1.Model.Types.DeploymentState)input.ReadEnum();
                    break;
                }

                case 82: {
                    Etag = input.ReadString();
                    break;
                }

                case 90: {
                    if (updateTime_ == null)
                    {
                        UpdateTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
                    }
                    input.ReadMessage(UpdateTime);
                    break;
                }

                case 106: {
                    global::Google.Cloud.AutoML.V1.ImageClassificationModelMetadata subBuilder = new global::Google.Cloud.AutoML.V1.ImageClassificationModelMetadata();
                    if (modelMetadataCase_ == ModelMetadataOneofCase.ImageClassificationModelMetadata)
                    {
                        subBuilder.MergeFrom(ImageClassificationModelMetadata);
                    }
                    input.ReadMessage(subBuilder);
                    ImageClassificationModelMetadata = subBuilder;
                    break;
                }

                case 114: {
                    global::Google.Cloud.AutoML.V1.TextClassificationModelMetadata subBuilder = new global::Google.Cloud.AutoML.V1.TextClassificationModelMetadata();
                    if (modelMetadataCase_ == ModelMetadataOneofCase.TextClassificationModelMetadata)
                    {
                        subBuilder.MergeFrom(TextClassificationModelMetadata);
                    }
                    input.ReadMessage(subBuilder);
                    TextClassificationModelMetadata = subBuilder;
                    break;
                }

                case 122: {
                    global::Google.Cloud.AutoML.V1.TranslationModelMetadata subBuilder = new global::Google.Cloud.AutoML.V1.TranslationModelMetadata();
                    if (modelMetadataCase_ == ModelMetadataOneofCase.TranslationModelMetadata)
                    {
                        subBuilder.MergeFrom(TranslationModelMetadata);
                    }
                    input.ReadMessage(subBuilder);
                    TranslationModelMetadata = subBuilder;
                    break;
                }

                case 154: {
                    global::Google.Cloud.AutoML.V1.TextExtractionModelMetadata subBuilder = new global::Google.Cloud.AutoML.V1.TextExtractionModelMetadata();
                    if (modelMetadataCase_ == ModelMetadataOneofCase.TextExtractionModelMetadata)
                    {
                        subBuilder.MergeFrom(TextExtractionModelMetadata);
                    }
                    input.ReadMessage(subBuilder);
                    TextExtractionModelMetadata = subBuilder;
                    break;
                }

                case 162: {
                    global::Google.Cloud.AutoML.V1.ImageObjectDetectionModelMetadata subBuilder = new global::Google.Cloud.AutoML.V1.ImageObjectDetectionModelMetadata();
                    if (modelMetadataCase_ == ModelMetadataOneofCase.ImageObjectDetectionModelMetadata)
                    {
                        subBuilder.MergeFrom(ImageObjectDetectionModelMetadata);
                    }
                    input.ReadMessage(subBuilder);
                    ImageObjectDetectionModelMetadata = subBuilder;
                    break;
                }

                case 178: {
                    global::Google.Cloud.AutoML.V1.TextSentimentModelMetadata subBuilder = new global::Google.Cloud.AutoML.V1.TextSentimentModelMetadata();
                    if (modelMetadataCase_ == ModelMetadataOneofCase.TextSentimentModelMetadata)
                    {
                        subBuilder.MergeFrom(TextSentimentModelMetadata);
                    }
                    input.ReadMessage(subBuilder);
                    TextSentimentModelMetadata = subBuilder;
                    break;
                }

                case 274: {
                    labels_.AddEntriesFrom(input, _map_labels_codec);
                    break;
                }
                }
            }
        }
Exemple #3
0
        public void MergeFrom(Model other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Name.Length != 0)
            {
                Name = other.Name;
            }
            if (other.DisplayName.Length != 0)
            {
                DisplayName = other.DisplayName;
            }
            if (other.DatasetId.Length != 0)
            {
                DatasetId = other.DatasetId;
            }
            if (other.createTime_ != null)
            {
                if (createTime_ == null)
                {
                    CreateTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
                }
                CreateTime.MergeFrom(other.CreateTime);
            }
            if (other.updateTime_ != null)
            {
                if (updateTime_ == null)
                {
                    UpdateTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
                }
                UpdateTime.MergeFrom(other.UpdateTime);
            }
            if (other.DeploymentState != global::Google.Cloud.AutoML.V1.Model.Types.DeploymentState.Unspecified)
            {
                DeploymentState = other.DeploymentState;
            }
            if (other.Etag.Length != 0)
            {
                Etag = other.Etag;
            }
            labels_.Add(other.labels_);
            switch (other.ModelMetadataCase)
            {
            case ModelMetadataOneofCase.TranslationModelMetadata:
                if (TranslationModelMetadata == null)
                {
                    TranslationModelMetadata = new global::Google.Cloud.AutoML.V1.TranslationModelMetadata();
                }
                TranslationModelMetadata.MergeFrom(other.TranslationModelMetadata);
                break;

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

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

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

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

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

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