示例#1
0
 public void MergeFrom(Asset other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Name.Length != 0)
     {
         Name = other.Name;
     }
     if (other.AssetType.Length != 0)
     {
         AssetType = other.AssetType;
     }
     if (other.resource_ != null)
     {
         if (resource_ == null)
         {
             Resource = new global::Google.Cloud.Asset.V1.Resource();
         }
         Resource.MergeFrom(other.Resource);
     }
     if (other.iamPolicy_ != null)
     {
         if (iamPolicy_ == null)
         {
             IamPolicy = new global::Google.Cloud.Iam.V1.Policy();
         }
         IamPolicy.MergeFrom(other.IamPolicy);
     }
     ancestors_.Add(other.ancestors_);
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
示例#2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (AssetType.Length != 0)
            {
                hash ^= AssetType.GetHashCode();
            }
            if (resource_ != null)
            {
                hash ^= Resource.GetHashCode();
            }
            if (iamPolicy_ != null)
            {
                hash ^= IamPolicy.GetHashCode();
            }
            hash ^= ancestors_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }