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

            if (modelMetadataCase_ == ModelMetadataOneofCase.TranslationModelMetadata)
            {
                hash ^= TranslationModelMetadata.GetHashCode();
            }
            if (modelMetadataCase_ == ModelMetadataOneofCase.ImageClassificationModelMetadata)
            {
                hash ^= ImageClassificationModelMetadata.GetHashCode();
            }
            if (modelMetadataCase_ == ModelMetadataOneofCase.TextClassificationModelMetadata)
            {
                hash ^= TextClassificationModelMetadata.GetHashCode();
            }
            if (modelMetadataCase_ == ModelMetadataOneofCase.ImageObjectDetectionModelMetadata)
            {
                hash ^= ImageObjectDetectionModelMetadata.GetHashCode();
            }
            if (modelMetadataCase_ == ModelMetadataOneofCase.TextExtractionModelMetadata)
            {
                hash ^= TextExtractionModelMetadata.GetHashCode();
            }
            if (modelMetadataCase_ == ModelMetadataOneofCase.TextSentimentModelMetadata)
            {
                hash ^= TextSentimentModelMetadata.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (DisplayName.Length != 0)
            {
                hash ^= DisplayName.GetHashCode();
            }
            if (DatasetId.Length != 0)
            {
                hash ^= DatasetId.GetHashCode();
            }
            if (createTime_ != null)
            {
                hash ^= CreateTime.GetHashCode();
            }
            if (updateTime_ != null)
            {
                hash ^= UpdateTime.GetHashCode();
            }
            if (DeploymentState != 0)
            {
                hash ^= DeploymentState.GetHashCode();
            }
            if (Etag.Length != 0)
            {
                hash ^= Etag.GetHashCode();
            }
            hash ^= Labels.GetHashCode();
            hash ^= (int)modelMetadataCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }