Exemple #1
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

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

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

                case 26: {
                    Put = input.ReadString();
                    break;
                }

                case 34: {
                    Post = input.ReadString();
                    break;
                }

                case 42: {
                    Delete = input.ReadString();
                    break;
                }

                case 50: {
                    Patch = input.ReadString();
                    break;
                }

                case 58: {
                    Body = input.ReadString();
                    break;
                }

                case 66: {
                    global::Google.Api.CustomHttpPattern subBuilder = new global::Google.Api.CustomHttpPattern();
                    if (patternCase_ == PatternOneofCase.Custom)
                    {
                        subBuilder.MergeFrom(Custom);
                    }
                    input.ReadMessage(subBuilder);
                    Custom = subBuilder;
                    break;
                }

                case 90: {
                    additionalBindings_.AddEntriesFrom(input, _repeated_additionalBindings_codec);
                    break;
                }
                }
            }
        }
Exemple #2
0
        public void MergeFrom(HttpRule other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Selector.Length != 0)
            {
                Selector = other.Selector;
            }
            if (other.Body.Length != 0)
            {
                Body = other.Body;
            }
            if (other.ResponseBody.Length != 0)
            {
                ResponseBody = other.ResponseBody;
            }
            additionalBindings_.Add(other.additionalBindings_);
            switch (other.PatternCase)
            {
            case PatternOneofCase.Get:
                Get = other.Get;
                break;

            case PatternOneofCase.Put:
                Put = other.Put;
                break;

            case PatternOneofCase.Post:
                Post = other.Post;
                break;

            case PatternOneofCase.Delete:
                Delete = other.Delete;
                break;

            case PatternOneofCase.Patch:
                Patch = other.Patch;
                break;

            case PatternOneofCase.Custom:
                if (Custom == null)
                {
                    Custom = new global::Google.Api.CustomHttpPattern();
                }
                Custom.MergeFrom(other.Custom);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }