コード例 #1
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: {
                    Description = input.ReadString();
                    break;
                }

                case 26: {
                    if (content_ == null)
                    {
                        Content = new global::Google.Protobuf.WellKnownTypes.Struct();
                    }
                    input.ReadMessage(Content);
                    break;
                }

                case 34: {
                    if (lastRefreshTime_ == null)
                    {
                        LastRefreshTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
                    }
                    input.ReadMessage(LastRefreshTime);
                    break;
                }

                case 42: {
                    if (observationPeriod_ == null)
                    {
                        ObservationPeriod = new global::Google.Protobuf.WellKnownTypes.Duration();
                    }
                    input.ReadMessage(ObservationPeriod);
                    break;
                }

                case 50: {
                    if (stateInfo_ == null)
                    {
                        StateInfo = new global::Google.Cloud.Recommender.V1.InsightStateInfo();
                    }
                    input.ReadMessage(StateInfo);
                    break;
                }

                case 56: {
                    Category = (global::Google.Cloud.Recommender.V1.Insight.Types.Category)input.ReadEnum();
                    break;
                }

                case 66: {
                    associatedRecommendations_.AddEntriesFrom(input, _repeated_associatedRecommendations_codec);
                    break;
                }

                case 74: {
                    targetResources_.AddEntriesFrom(input, _repeated_targetResources_codec);
                    break;
                }

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

                case 90: {
                    Etag = input.ReadString();
                    break;
                }
                }
            }
        }
コード例 #2
0
 public void MergeFrom(Insight other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Name.Length != 0)
     {
         Name = other.Name;
     }
     if (other.Description.Length != 0)
     {
         Description = other.Description;
     }
     targetResources_.Add(other.targetResources_);
     if (other.InsightSubtype.Length != 0)
     {
         InsightSubtype = other.InsightSubtype;
     }
     if (other.content_ != null)
     {
         if (content_ == null)
         {
             Content = new global::Google.Protobuf.WellKnownTypes.Struct();
         }
         Content.MergeFrom(other.Content);
     }
     if (other.lastRefreshTime_ != null)
     {
         if (lastRefreshTime_ == null)
         {
             LastRefreshTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
         }
         LastRefreshTime.MergeFrom(other.LastRefreshTime);
     }
     if (other.observationPeriod_ != null)
     {
         if (observationPeriod_ == null)
         {
             ObservationPeriod = new global::Google.Protobuf.WellKnownTypes.Duration();
         }
         ObservationPeriod.MergeFrom(other.ObservationPeriod);
     }
     if (other.stateInfo_ != null)
     {
         if (stateInfo_ == null)
         {
             StateInfo = new global::Google.Cloud.Recommender.V1.InsightStateInfo();
         }
         StateInfo.MergeFrom(other.StateInfo);
     }
     if (other.Category != global::Google.Cloud.Recommender.V1.Insight.Types.Category.Unspecified)
     {
         Category = other.Category;
     }
     if (other.Etag.Length != 0)
     {
         Etag = other.Etag;
     }
     associatedRecommendations_.Add(other.associatedRecommendations_);
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }