コード例 #1
0
ファイル: Service.cs プロジェクト: mbrukman/gax-dotnet
 public void MergeFrom(Service other)
 {
     if (other == null)
     {
         return;
     }
     if (other.configVersion_ != null)
     {
         if (configVersion_ == null || other.ConfigVersion != 0)
         {
             ConfigVersion = other.ConfigVersion;
         }
     }
     if (other.Name.Length != 0)
     {
         Name = other.Name;
     }
     if (other.Id.Length != 0)
     {
         Id = other.Id;
     }
     if (other.Title.Length != 0)
     {
         Title = other.Title;
     }
     if (other.ProducerProjectId.Length != 0)
     {
         ProducerProjectId = other.ProducerProjectId;
     }
     apis_.Add(other.apis_);
     types_.Add(other.types_);
     enums_.Add(other.enums_);
     if (other.documentation_ != null)
     {
         if (documentation_ == null)
         {
             documentation_ = new global::Google.Api.Documentation();
         }
         Documentation.MergeFrom(other.Documentation);
     }
     if (other.backend_ != null)
     {
         if (backend_ == null)
         {
             backend_ = new global::Google.Api.Backend();
         }
         Backend.MergeFrom(other.Backend);
     }
     if (other.http_ != null)
     {
         if (http_ == null)
         {
             http_ = new global::Google.Api.Http();
         }
         Http.MergeFrom(other.Http);
     }
     if (other.quota_ != null)
     {
         if (quota_ == null)
         {
             quota_ = new global::Google.Api.Quota();
         }
         Quota.MergeFrom(other.Quota);
     }
     if (other.authentication_ != null)
     {
         if (authentication_ == null)
         {
             authentication_ = new global::Google.Api.Authentication();
         }
         Authentication.MergeFrom(other.Authentication);
     }
     if (other.context_ != null)
     {
         if (context_ == null)
         {
             context_ = new global::Google.Api.Context();
         }
         Context.MergeFrom(other.Context);
     }
     if (other.usage_ != null)
     {
         if (usage_ == null)
         {
             usage_ = new global::Google.Api.Usage();
         }
         Usage.MergeFrom(other.Usage);
     }
     endpoints_.Add(other.endpoints_);
     if (other.control_ != null)
     {
         if (control_ == null)
         {
             control_ = new global::Google.Api.Control();
         }
         Control.MergeFrom(other.Control);
     }
     logs_.Add(other.logs_);
     metrics_.Add(other.metrics_);
     monitoredResources_.Add(other.monitoredResources_);
     if (other.logging_ != null)
     {
         if (logging_ == null)
         {
             logging_ = new global::Google.Api.Logging();
         }
         Logging.MergeFrom(other.Logging);
     }
     if (other.monitoring_ != null)
     {
         if (monitoring_ == null)
         {
             monitoring_ = new global::Google.Api.Monitoring();
         }
         Monitoring.MergeFrom(other.Monitoring);
     }
     if (other.systemParameters_ != null)
     {
         if (systemParameters_ == null)
         {
             systemParameters_ = new global::Google.Api.SystemParameters();
         }
         SystemParameters.MergeFrom(other.SystemParameters);
     }
     if (other.sourceInfo_ != null)
     {
         if (sourceInfo_ == null)
         {
             sourceInfo_ = new global::Google.Api.SourceInfo();
         }
         SourceInfo.MergeFrom(other.SourceInfo);
     }
     if (other.experimental_ != null)
     {
         if (experimental_ == null)
         {
             experimental_ = new global::Google.Api.Experimental();
         }
         Experimental.MergeFrom(other.Experimental);
     }
 }
コード例 #2
0
ファイル: Service.cs プロジェクト: mbrukman/gax-dotnet
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    input.SkipLastField();
                    break;

                case 10: {
                    Name = input.ReadString();
                    break;
                }

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

                case 26: {
                    apis_.AddEntriesFrom(input, _repeated_apis_codec);
                    break;
                }

                case 34: {
                    types_.AddEntriesFrom(input, _repeated_types_codec);
                    break;
                }

                case 42: {
                    enums_.AddEntriesFrom(input, _repeated_enums_codec);
                    break;
                }

                case 50: {
                    if (documentation_ == null)
                    {
                        documentation_ = new global::Google.Api.Documentation();
                    }
                    input.ReadMessage(documentation_);
                    break;
                }

                case 66: {
                    if (backend_ == null)
                    {
                        backend_ = new global::Google.Api.Backend();
                    }
                    input.ReadMessage(backend_);
                    break;
                }

                case 74: {
                    if (http_ == null)
                    {
                        http_ = new global::Google.Api.Http();
                    }
                    input.ReadMessage(http_);
                    break;
                }

                case 82: {
                    if (quota_ == null)
                    {
                        quota_ = new global::Google.Api.Quota();
                    }
                    input.ReadMessage(quota_);
                    break;
                }

                case 90: {
                    if (authentication_ == null)
                    {
                        authentication_ = new global::Google.Api.Authentication();
                    }
                    input.ReadMessage(authentication_);
                    break;
                }

                case 98: {
                    if (context_ == null)
                    {
                        context_ = new global::Google.Api.Context();
                    }
                    input.ReadMessage(context_);
                    break;
                }

                case 122: {
                    if (usage_ == null)
                    {
                        usage_ = new global::Google.Api.Usage();
                    }
                    input.ReadMessage(usage_);
                    break;
                }

                case 146: {
                    endpoints_.AddEntriesFrom(input, _repeated_endpoints_codec);
                    break;
                }

                case 162: {
                    uint?value = _single_configVersion_codec.Read(input);
                    if (configVersion_ == null || value != 0)
                    {
                        ConfigVersion = value;
                    }
                    break;
                }

                case 170: {
                    if (control_ == null)
                    {
                        control_ = new global::Google.Api.Control();
                    }
                    input.ReadMessage(control_);
                    break;
                }

                case 178: {
                    ProducerProjectId = input.ReadString();
                    break;
                }

                case 186: {
                    logs_.AddEntriesFrom(input, _repeated_logs_codec);
                    break;
                }

                case 194: {
                    metrics_.AddEntriesFrom(input, _repeated_metrics_codec);
                    break;
                }

                case 202: {
                    monitoredResources_.AddEntriesFrom(input, _repeated_monitoredResources_codec);
                    break;
                }

                case 218: {
                    if (logging_ == null)
                    {
                        logging_ = new global::Google.Api.Logging();
                    }
                    input.ReadMessage(logging_);
                    break;
                }

                case 226: {
                    if (monitoring_ == null)
                    {
                        monitoring_ = new global::Google.Api.Monitoring();
                    }
                    input.ReadMessage(monitoring_);
                    break;
                }

                case 234: {
                    if (systemParameters_ == null)
                    {
                        systemParameters_ = new global::Google.Api.SystemParameters();
                    }
                    input.ReadMessage(systemParameters_);
                    break;
                }

                case 266: {
                    Id = input.ReadString();
                    break;
                }

                case 298: {
                    if (sourceInfo_ == null)
                    {
                        sourceInfo_ = new global::Google.Api.SourceInfo();
                    }
                    input.ReadMessage(sourceInfo_);
                    break;
                }

                case 810: {
                    if (experimental_ == null)
                    {
                        experimental_ = new global::Google.Api.Experimental();
                    }
                    input.ReadMessage(experimental_);
                    break;
                }
                }
            }
        }