Esempio n. 1
0
 public void MergeFrom(Annotation other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Name.Length != 0)
     {
         Name = other.Name;
     }
     if (other.PayloadSchemaUri.Length != 0)
     {
         PayloadSchemaUri = other.PayloadSchemaUri;
     }
     if (other.payload_ != null)
     {
         if (payload_ == null)
         {
             Payload = new global::Google.Protobuf.WellKnownTypes.Value();
         }
         Payload.MergeFrom(other.Payload);
     }
     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.Etag.Length != 0)
     {
         Etag = other.Etag;
     }
     if (other.annotationSource_ != null)
     {
         if (annotationSource_ == null)
         {
             AnnotationSource = new global::Google.Cloud.AIPlatform.V1.UserActionReference();
         }
         AnnotationSource.MergeFrom(other.AnnotationSource);
     }
     labels_.Add(other.labels_);
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
 public override int GetHashCode() {
   int hash = 1;
   if (Name.Length != 0) hash ^= Name.GetHashCode();
   if (PayloadSchemaUri.Length != 0) hash ^= PayloadSchemaUri.GetHashCode();
   if (payload_ != null) hash ^= Payload.GetHashCode();
   if (createTime_ != null) hash ^= CreateTime.GetHashCode();
   if (updateTime_ != null) hash ^= UpdateTime.GetHashCode();
   if (Etag.Length != 0) hash ^= Etag.GetHashCode();
   if (annotationSource_ != null) hash ^= AnnotationSource.GetHashCode();
   hash ^= Labels.GetHashCode();
   if (_unknownFields != null) {
     hash ^= _unknownFields.GetHashCode();
   }
   return hash;
 }
Esempio n. 3
0
        public static AnnotationSourceModel ToModel(this AnnotationSource entity)
        {
            AnnotationSourceModel model = null;

            if (entity != null)
            {
                model = new AnnotationSourceModel
                {
                    Id = entity.AnnotationSourceId,
                    RerumStorageUrl = entity.RerumStorageUrl,
                    ImageHeight     = entity.ImageHeight,
                    ImageWidth      = entity.ImageWidth,
                    SourceUrl       = entity.SourceUrl,
                    CreatedDate     = entity.CreatedDate,
                    CreatedUser     = entity.CreatedUser,
                    UpdatedDate     = entity.UpdatedDate,
                    UpdatedUser     = entity.UpdatedUser,
                    Targets         = entity.Targets?.ToList().ConvertAll(t => t.ToModel())
                };
            }
            return(model);
        }
Esempio n. 4
0
        public static AnnotationSource ToEntity(this AnnotationSourceModel model, AnnotationSource entity = null)
        {
            AnnotationSource rt = null;

            if (model != null)
            {
                if (entity == null)
                {
                    rt = new AnnotationSource()
                    {
                        AnnotationSourceId = model.Id,
                    };
                }
                else
                {
                    rt = entity;
                }

                return(PopulateEntity(model, rt));
            }
            return(rt);
        }
Esempio n. 5
0
 public static AnnotationSource PopulateEntity(this AnnotationSourceModel model, AnnotationSource entity)
 {
     entity.RerumStorageUrl = model.RerumStorageUrl;
     entity.ImageHeight     = model.ImageHeight;
     entity.ImageWidth      = model.ImageWidth;
     entity.SourceUrl       = model.SourceUrl;
     entity.CreatedDate     = model.CreatedDate;
     entity.CreatedUser     = model.CreatedUser;
     entity.UpdatedDate     = model.UpdatedDate;
     entity.UpdatedUser     = model.UpdatedUser;
     return(entity);
 }