aboutsummaryrefslogblamecommitdiff
path: root/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestNoFieldPresence.cs
blob: 52d7a69bf9b951786261e6e6c6abf9f63ec19bf9 (plain) (tree)
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876


































































































                                                                                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           












































































































































































































































































































































                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           












                                                                           


























































































































































                                                                                                                                                                                                    
                                                    











                                                                                 
                                                    











                                                                                   
                                                     











                                                                                    
                                                     











                                                                                      
                                                     











                                                                                  
                                                     











                                                                                    
                                                      











                                                                                     
                                                      











                                                                                       
                                                       











                                                                                    
                                                       











                                                                                      
                                                    











                                                                                     
                                                     











                                                                                        
                                                   







































































                                                                                                                                                                                                                                                     
                                                         











                                                                                                                                                                                                                                            
                                                          















































                                                                                                                                                                                                                                                   
                             
                                                                                                 


                                                         
                                                                                                                 
                                                                                                                                                                                                                                                                                     


                                                  
                               
                                                                                                    


                                                
                                                                                                     
                                                                                                                                                                                                                                                          










































































                                                                                                                     
                                                                                                               

                                     
                                                                                                               

                                      
                                                                                                                  

                                      
                                                                                                                  

                                      
                                                                                                                  

                                      
                                                                                                                  

                                       
                                                                                                                     

                                       
                                                                                                                     

                                        
                                                                                                                        

                                        
                                                                                                                        

                                     
                                                                                                               

                                      
                                                                                                                  

                                    
                                                                                                            
















                                                                               
                                                                                                                        

                                           
                                                                                                                          









                                                                            
                                                               

                                                             
                                                                      

                                                                     
                                                               

                                                             
                                                             





























































































                                                                                                                     



                                                                            






                                                                           



                                                                            






                                                                            



                                                                            






                                                                            



                                                                            






                                                                            



                                                                            






                                                                            



                                                                            




                                              



                                                                            




                                              



                                                                            




                                               



                                                                            




                                               



                                                                            




                                            



                                                                            




                                             



                                                                            




                                           



                                                                            
































                                                                                                                                        

                                                                                
         
                                                            







                                                                                                                  

                                                                                
         
                                                             



















                                                                                                                                      
                                                               

                                                                          
                                                                      

                                                                                  
                                                               

                                                                          
                                                             




























































































































































































































































































                                                                                                                             

















                                                              







































































































































































































































































































                                                                                                                                                                                                                       




                                                                         



                                                                                                                                                                                                                       
                                                                                     


                                                               

                                                                              


                       




                                                                         



                             



                                                                                                                                                                                            





































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                                                                                           
                                                                                                                 



                                                 

                                                                 



                                         


                                                                        


                    
                                                                                                                   
                                                                                                                                                                                                                                                                                                     




                                                                                                                                     

                                                                        




                                                                                                                                                       

                                                                        




                                                                                                                                       


                                                                                                                                                                                          
                
                                     
         
                                                                        


                                                




                                                                               



                                 
                                                                                                                    




                                                    

                                                                 



                                         


                                                                        



                                                                                                       
                                                                                                                                                                                                                                                                          



                                                                                                                         

                                                               



                                       












                                                                      






















































































































































































































































































































































































































































































































































































                                                                                                                                                                                      
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/protobuf/unittest_no_field_presence.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using pb = global::Google.ProtocolBuffers;
using pbc = global::Google.ProtocolBuffers.Collections;
using pbd = global::Google.ProtocolBuffers.Descriptors;
using scg = global::System.Collections.Generic;
namespace Google.ProtocolBuffers.TestProtos.Proto3 {

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public static partial class UnittestNoFieldPresence {

    #region Extension registration
    public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
    }
    #endregion
    #region Static variables
    internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor;
    internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Builder> internal__static_proto2_nofieldpresence_unittest_TestAllTypes__FieldAccessorTable;
    internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor;
    internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder> internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__FieldAccessorTable;
    internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor;
    internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required, global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required.Builder> internal__static_proto2_nofieldpresence_unittest_TestProto2Required__FieldAccessorTable;
    internal static pbd::MessageDescriptor internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor;
    internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder> internal__static_proto2_nofieldpresence_unittest_ForeignMessage__FieldAccessorTable;
    #endregion
    #region Descriptor
    public static pbd::FileDescriptor Descriptor {
      get { return descriptor; }
    }
    private static pbd::FileDescriptor descriptor;

    static UnittestNoFieldPresence() {
      byte[] descriptorData = global::System.Convert.FromBase64String(
          string.Concat(
            "CjBnb29nbGUvcHJvdG9idWYvdW5pdHRlc3Rfbm9fZmllbGRfcHJlc2VuY2Uu", 
            "cHJvdG8SH3Byb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3QaHmdvb2ds", 
            "ZS9wcm90b2J1Zi91bml0dGVzdC5wcm90byKaEQoMVGVzdEFsbFR5cGVzEhYK", 
            "Dm9wdGlvbmFsX2ludDMyGAEgASgFEhYKDm9wdGlvbmFsX2ludDY0GAIgASgD", 
            "EhcKD29wdGlvbmFsX3VpbnQzMhgDIAEoDRIXCg9vcHRpb25hbF91aW50NjQY", 
            "BCABKAQSFwoPb3B0aW9uYWxfc2ludDMyGAUgASgREhcKD29wdGlvbmFsX3Np", 
            "bnQ2NBgGIAEoEhIYChBvcHRpb25hbF9maXhlZDMyGAcgASgHEhgKEG9wdGlv", 
            "bmFsX2ZpeGVkNjQYCCABKAYSGQoRb3B0aW9uYWxfc2ZpeGVkMzIYCSABKA8S", 
            "GQoRb3B0aW9uYWxfc2ZpeGVkNjQYCiABKBASFgoOb3B0aW9uYWxfZmxvYXQY", 
            "CyABKAISFwoPb3B0aW9uYWxfZG91YmxlGAwgASgBEhUKDW9wdGlvbmFsX2Jv", 
            "b2wYDSABKAgSFwoPb3B0aW9uYWxfc3RyaW5nGA4gASgJEhYKDm9wdGlvbmFs", 
            "X2J5dGVzGA8gASgMElwKF29wdGlvbmFsX25lc3RlZF9tZXNzYWdlGBIgASgL", 
            "MjsucHJvdG8yX25vZmllbGRwcmVzZW5jZV91bml0dGVzdC5UZXN0QWxsVHlw", 
            "ZXMuTmVzdGVkTWVzc2FnZRJRChhvcHRpb25hbF9mb3JlaWduX21lc3NhZ2UY", 
            "EyABKAsyLy5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0ZXN0LkZvcmVp", 
            "Z25NZXNzYWdlEkAKF29wdGlvbmFsX3Byb3RvMl9tZXNzYWdlGBQgASgLMh8u", 
            "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbFR5cGVzElYKFG9wdGlvbmFsX25l", 
            "c3RlZF9lbnVtGBUgASgOMjgucHJvdG8yX25vZmllbGRwcmVzZW5jZV91bml0", 
            "dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkRW51bRJLChVvcHRpb25hbF9mb3Jl", 
            "aWduX2VudW0YFiABKA4yLC5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0", 
            "ZXN0LkZvcmVpZ25FbnVtEiEKFW9wdGlvbmFsX3N0cmluZ19waWVjZRgYIAEo", 
            "CUICCAISGQoNb3B0aW9uYWxfY29yZBgZIAEoCUICCAESXgoVb3B0aW9uYWxf", 
            "bGF6eV9tZXNzYWdlGB4gASgLMjsucHJvdG8yX25vZmllbGRwcmVzZW5jZV91", 
            "bml0dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZUICKAESFgoOcmVw", 
            "ZWF0ZWRfaW50MzIYHyADKAUSFgoOcmVwZWF0ZWRfaW50NjQYICADKAMSFwoP", 
            "cmVwZWF0ZWRfdWludDMyGCEgAygNEhcKD3JlcGVhdGVkX3VpbnQ2NBgiIAMo", 
            "BBIXCg9yZXBlYXRlZF9zaW50MzIYIyADKBESFwoPcmVwZWF0ZWRfc2ludDY0", 
            "GCQgAygSEhgKEHJlcGVhdGVkX2ZpeGVkMzIYJSADKAcSGAoQcmVwZWF0ZWRf", 
            "Zml4ZWQ2NBgmIAMoBhIZChFyZXBlYXRlZF9zZml4ZWQzMhgnIAMoDxIZChFy", 
            "ZXBlYXRlZF9zZml4ZWQ2NBgoIAMoEBIWCg5yZXBlYXRlZF9mbG9hdBgpIAMo", 
            "AhIXCg9yZXBlYXRlZF9kb3VibGUYKiADKAESFQoNcmVwZWF0ZWRfYm9vbBgr", 
            "IAMoCBIXCg9yZXBlYXRlZF9zdHJpbmcYLCADKAkSFgoOcmVwZWF0ZWRfYnl0", 
            "ZXMYLSADKAwSXAoXcmVwZWF0ZWRfbmVzdGVkX21lc3NhZ2UYMCADKAsyOy5w", 
            "cm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0ZXN0LlRlc3RBbGxUeXBlcy5O", 
            "ZXN0ZWRNZXNzYWdlElEKGHJlcGVhdGVkX2ZvcmVpZ25fbWVzc2FnZRgxIAMo", 
            "CzIvLnByb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3QuRm9yZWlnbk1l", 
            "c3NhZ2USQAoXcmVwZWF0ZWRfcHJvdG8yX21lc3NhZ2UYMiADKAsyHy5wcm90", 
            "b2J1Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMSVgoUcmVwZWF0ZWRfbmVzdGVk", 
            "X2VudW0YMyADKA4yOC5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0ZXN0", 
            "LlRlc3RBbGxUeXBlcy5OZXN0ZWRFbnVtEksKFXJlcGVhdGVkX2ZvcmVpZ25f", 
            "ZW51bRg0IAMoDjIsLnByb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3Qu", 
            "Rm9yZWlnbkVudW0SIQoVcmVwZWF0ZWRfc3RyaW5nX3BpZWNlGDYgAygJQgII", 
            "AhIZCg1yZXBlYXRlZF9jb3JkGDcgAygJQgIIARJeChVyZXBlYXRlZF9sYXp5", 
            "X21lc3NhZ2UYOSADKAsyOy5wcm90bzJfbm9maWVsZHByZXNlbmNlX3VuaXR0", 
            "ZXN0LlRlc3RBbGxUeXBlcy5OZXN0ZWRNZXNzYWdlQgIoARIWCgxvbmVvZl91", 
            "aW50MzIYbyABKA1IABJbChRvbmVvZl9uZXN0ZWRfbWVzc2FnZRhwIAEoCzI7", 
            "LnByb3RvMl9ub2ZpZWxkcHJlc2VuY2VfdW5pdHRlc3QuVGVzdEFsbFR5cGVz", 
            "Lk5lc3RlZE1lc3NhZ2VIABIWCgxvbmVvZl9zdHJpbmcYcSABKAlIABJOCgpv", 
            "bmVvZl9lbnVtGHIgASgOMjgucHJvdG8yX25vZmllbGRwcmVzZW5jZV91bml0", 
            "dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkRW51bUgAGhsKDU5lc3RlZE1lc3Nh", 
            "Z2USCgoCYmIYASABKAUiJwoKTmVzdGVkRW51bRIHCgNGT08QABIHCgNCQVIQ", 
            "ARIHCgNCQVoQAkINCgtvbmVvZl9maWVsZCJFChJUZXN0UHJvdG8yUmVxdWly", 
            "ZWQSLwoGcHJvdG8yGAEgASgLMh8ucHJvdG9idWZfdW5pdHRlc3QuVGVzdFJl", 
            "cXVpcmVkIhsKDkZvcmVpZ25NZXNzYWdlEgkKAWMYASABKAUqQAoLRm9yZWln", 
            "bkVudW0SDwoLRk9SRUlHTl9GT08QABIPCgtGT1JFSUdOX0JBUhABEg8KC0ZP", 
            "UkVJR05fQkFaEAJCK6oCKEdvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFBy", 
          "b3Rvcy5Qcm90bzNiBnByb3RvMw=="));
      pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
        descriptor = root;
        internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor = Descriptor.MessageTypes[0];
        internal__static_proto2_nofieldpresence_unittest_TestAllTypes__FieldAccessorTable = 
            new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Builder>(internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor,
                new string[] { "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalProto2Message", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalStringPiece", "OptionalCord", "OptionalLazyMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedProto2Message", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedStringPiece", "RepeatedCord", "RepeatedLazyMessage", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofEnum", "OneofField", });
        internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor = internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor.NestedTypes[0];
        internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__FieldAccessorTable = 
            new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder>(internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor,
                new string[] { "Bb", });
        internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor = Descriptor.MessageTypes[1];
        internal__static_proto2_nofieldpresence_unittest_TestProto2Required__FieldAccessorTable = 
            new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required, global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required.Builder>(internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor,
                new string[] { "Proto2", });
        internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor = Descriptor.MessageTypes[2];
        internal__static_proto2_nofieldpresence_unittest_ForeignMessage__FieldAccessorTable = 
            new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder>(internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor,
                new string[] { "C", });
        pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance();
        RegisterAllExtensions(registry);
        global::Google.ProtocolBuffers.TestProtos.Unittest.RegisterAllExtensions(registry);
        return registry;
      };
      pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
          new pbd::FileDescriptor[] {
          global::Google.ProtocolBuffers.TestProtos.Unittest.Descriptor, 
          }, assigner);
    }
    #endregion

  }
  #region Enums
  public enum ForeignEnum {
    FOREIGN_FOO = 0,
    FOREIGN_BAR = 1,
    FOREIGN_BAZ = 2,
  }

  #endregion

  #region Messages
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class TestAllTypes : pb::GeneratedMessage<TestAllTypes, TestAllTypes.Builder> {
    private TestAllTypes() { }
    private static readonly TestAllTypes defaultInstance = new TestAllTypes().MakeReadOnly();
    private static readonly string[] _testAllTypesFieldNames = new string[] { "oneof_enum", "oneof_nested_message", "oneof_string", "oneof_uint32", "optional_bool", "optional_bytes", "optional_cord", "optional_double", "optional_fixed32", "optional_fixed64", "optional_float", "optional_foreign_enum", "optional_foreign_message", "optional_int32", "optional_int64", "optional_lazy_message", "optional_nested_enum", "optional_nested_message", "optional_proto2_message", "optional_sfixed32", "optional_sfixed64", "optional_sint32", "optional_sint64", "optional_string", "optional_string_piece", "optional_uint32", "optional_uint64", "repeated_bool", "repeated_bytes", "repeated_cord", "repeated_double", "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_foreign_enum", "repeated_foreign_message", "repeated_int32", "repeated_int64", "repeated_lazy_message", "repeated_nested_enum", "repeated_nested_message", "repeated_proto2_message", "repeated_sfixed32", "repeated_sfixed64", "repeated_sint32", "repeated_sint64", "repeated_string", "repeated_string_piece", "repeated_uint32", "repeated_uint64" };
    private static readonly uint[] _testAllTypesFieldTags = new uint[] { 912, 898, 906, 888, 104, 122, 202, 97, 61, 65, 93, 176, 154, 8, 16, 242, 168, 146, 162, 77, 81, 40, 48, 114, 194, 24, 32, 344, 362, 442, 337, 301, 305, 333, 416, 394, 248, 256, 458, 408, 386, 402, 317, 321, 280, 288, 354, 434, 264, 272 };
    public static TestAllTypes DefaultInstance {
      get { return defaultInstance; }
    }

    public override TestAllTypes DefaultInstanceForType {
      get { return DefaultInstance; }
    }

    protected override TestAllTypes ThisMessage {
      get { return this; }
    }

    public static pbd::MessageDescriptor Descriptor {
      get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes__Descriptor; }
    }

    protected override pb::FieldAccess.FieldAccessorTable<TestAllTypes, TestAllTypes.Builder> InternalFieldAccessors {
      get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes__FieldAccessorTable; }
    }

    #region Nested types
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    public static partial class Types {
      public enum NestedEnum {
        FOO = 0,
        BAR = 1,
        BAZ = 2,
      }

      [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
      public sealed partial class NestedMessage : pb::GeneratedMessage<NestedMessage, NestedMessage.Builder> {
        private NestedMessage() { }
        private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly();
        private static readonly string[] _nestedMessageFieldNames = new string[] { "bb" };
        private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 };
        public static NestedMessage DefaultInstance {
          get { return defaultInstance; }
        }

        public override NestedMessage DefaultInstanceForType {
          get { return DefaultInstance; }
        }

        protected override NestedMessage ThisMessage {
          get { return this; }
        }

        public static pbd::MessageDescriptor Descriptor {
          get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__Descriptor; }
        }

        protected override pb::FieldAccess.FieldAccessorTable<NestedMessage, NestedMessage.Builder> InternalFieldAccessors {
          get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; }
        }

        public const int BbFieldNumber = 1;
        private int bb_;
        public int Bb {
          get { return bb_; }
        }

        public override void WriteTo(pb::ICodedOutputStream output) {
          CalcSerializedSize();
          string[] field_names = _nestedMessageFieldNames;
          if (Bb != 0) {
            output.WriteInt32(1, field_names[0], Bb);
          }
          UnknownFields.WriteTo(output);
        }

        private int memoizedSerializedSize = -1;
        public override int SerializedSize {
          get {
            int size = memoizedSerializedSize;
            if (size != -1) return size;
            return CalcSerializedSize();
          }
        }

        private int CalcSerializedSize() {
          int size = memoizedSerializedSize;
          if (size != -1) return size;

          size = 0;
          if (Bb != 0) {
            size += pb::CodedOutputStream.ComputeInt32Size(1, Bb);
          }
          size += UnknownFields.SerializedSize;
          memoizedSerializedSize = size;
          return size;
        }
        public static NestedMessage ParseFrom(pb::ByteString data) {
          return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
        }
        public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
          return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
        }
        public static NestedMessage ParseFrom(byte[] data) {
          return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
        }
        public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
          return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
        }
        public static NestedMessage ParseFrom(global::System.IO.Stream input) {
          return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
        }
        public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
          return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
        }
        public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) {
          return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
        }
        public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
          return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
        }
        public static NestedMessage ParseFrom(pb::ICodedInputStream input) {
          return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
        }
        public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
          return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
        }
        private NestedMessage MakeReadOnly() {
          return this;
        }

        public static Builder CreateBuilder() { return new Builder(); }
        public override Builder ToBuilder() { return CreateBuilder(this); }
        public override Builder CreateBuilderForType() { return new Builder(); }
        public static Builder CreateBuilder(NestedMessage prototype) {
          return new Builder(prototype);
        }

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public sealed partial class Builder : pb::GeneratedBuilder<NestedMessage, Builder> {
          protected override Builder ThisBuilder {
            get { return this; }
          }
          public Builder() {
            result = DefaultInstance;
            resultIsReadOnly = true;
          }
          internal Builder(NestedMessage cloneFrom) {
            result = cloneFrom;
            resultIsReadOnly = true;
          }

          private bool resultIsReadOnly;
          private NestedMessage result;

          private NestedMessage PrepareBuilder() {
            if (resultIsReadOnly) {
              NestedMessage original = result;
              result = new NestedMessage();
              resultIsReadOnly = false;
              MergeFrom(original);
            }
            return result;
          }

          public override bool IsInitialized {
            get { return result.IsInitialized; }
          }

          protected override NestedMessage MessageBeingBuilt {
            get { return PrepareBuilder(); }
          }

          public override Builder Clear() {
            result = DefaultInstance;
            resultIsReadOnly = true;
            return this;
          }

          public override Builder Clone() {
            if (resultIsReadOnly) {
              return new Builder(result);
            } else {
              return new Builder().MergeFrom(result);
            }
          }

          public override pbd::MessageDescriptor DescriptorForType {
            get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Descriptor; }
          }

          public override NestedMessage DefaultInstanceForType {
            get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance; }
          }

          public override NestedMessage BuildPartial() {
            if (resultIsReadOnly) {
              return result;
            }
            resultIsReadOnly = true;
            return result.MakeReadOnly();
          }

          public override Builder MergeFrom(pb::IMessage other) {
            if (other is NestedMessage) {
              return MergeFrom((NestedMessage) other);
            } else {
              base.MergeFrom(other);
              return this;
            }
          }

          public override Builder MergeFrom(NestedMessage other) {
            if (other == global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance) return this;
            PrepareBuilder();
            if (other.Bb != 0) {
              Bb = other.Bb;
            }
            this.MergeUnknownFields(other.UnknownFields);
            return this;
          }

          public override Builder MergeFrom(pb::ICodedInputStream input) {
            return MergeFrom(input, pb::ExtensionRegistry.Empty);
          }

          public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
            PrepareBuilder();
            pb::UnknownFieldSet.Builder unknownFields = null;
            uint tag;
            string field_name;
            while (input.ReadTag(out tag, out field_name)) {
              if(tag == 0 && field_name != null) {
                int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal);
                if(field_ordinal >= 0)
                  tag = _nestedMessageFieldTags[field_ordinal];
                else {
                  if (unknownFields == null) {
                    unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                  }
                  ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
                  continue;
                }
              }
              switch (tag) {
                case 0: {
                  throw pb::InvalidProtocolBufferException.InvalidTag();
                }
                default: {
                  if (pb::WireFormat.IsEndGroupTag(tag)) {
                    if (unknownFields != null) {
                      this.UnknownFields = unknownFields.Build();
                    }
                    return this;
                  }
                  if (unknownFields == null) {
                    unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                  }
                  ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
                  break;
                }
                case 8: {
                  input.ReadInt32(ref result.bb_);
                  break;
                }
              }
            }

            if (unknownFields != null) {
              this.UnknownFields = unknownFields.Build();
            }
            return this;
          }


          public int Bb {
            get { return result.Bb; }
            set { SetBb(value); }
          }
          public Builder SetBb(int value) {
            PrepareBuilder();
            result.bb_ = value;
            return this;
          }
          public Builder ClearBb() {
            PrepareBuilder();
            result.bb_ = 0;
            return this;
          }
        }
        static NestedMessage() {
          object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.Descriptor, null);
        }
      }

    }
    #endregion

    private object oneofField_;
    public enum OneofFieldOneofCase {
      OneofUint32 = 111,
      OneofNestedMessage = 112,
      OneofString = 113,
      OneofEnum = 114,
      None = 0,
    }
    private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None;
    public OneofFieldOneofCase OneofFieldCase {
      get { return oneofFieldCase_; }
    }

    public const int OptionalInt32FieldNumber = 1;
    private int optionalInt32_;
    public int OptionalInt32 {
      get { return optionalInt32_; }
    }

    public const int OptionalInt64FieldNumber = 2;
    private long optionalInt64_;
    public long OptionalInt64 {
      get { return optionalInt64_; }
    }

    public const int OptionalUint32FieldNumber = 3;
    private uint optionalUint32_;
    public uint OptionalUint32 {
      get { return optionalUint32_; }
    }

    public const int OptionalUint64FieldNumber = 4;
    private ulong optionalUint64_;
    public ulong OptionalUint64 {
      get { return optionalUint64_; }
    }

    public const int OptionalSint32FieldNumber = 5;
    private int optionalSint32_;
    public int OptionalSint32 {
      get { return optionalSint32_; }
    }

    public const int OptionalSint64FieldNumber = 6;
    private long optionalSint64_;
    public long OptionalSint64 {
      get { return optionalSint64_; }
    }

    public const int OptionalFixed32FieldNumber = 7;
    private uint optionalFixed32_;
    public uint OptionalFixed32 {
      get { return optionalFixed32_; }
    }

    public const int OptionalFixed64FieldNumber = 8;
    private ulong optionalFixed64_;
    public ulong OptionalFixed64 {
      get { return optionalFixed64_; }
    }

    public const int OptionalSfixed32FieldNumber = 9;
    private int optionalSfixed32_;
    public int OptionalSfixed32 {
      get { return optionalSfixed32_; }
    }

    public const int OptionalSfixed64FieldNumber = 10;
    private long optionalSfixed64_;
    public long OptionalSfixed64 {
      get { return optionalSfixed64_; }
    }

    public const int OptionalFloatFieldNumber = 11;
    private float optionalFloat_;
    public float OptionalFloat {
      get { return optionalFloat_; }
    }

    public const int OptionalDoubleFieldNumber = 12;
    private double optionalDouble_;
    public double OptionalDouble {
      get { return optionalDouble_; }
    }

    public const int OptionalBoolFieldNumber = 13;
    private bool optionalBool_;
    public bool OptionalBool {
      get { return optionalBool_; }
    }

    public const int OptionalStringFieldNumber = 14;
    private string optionalString_ = "";
    public string OptionalString {
      get { return optionalString_; }
    }

    public const int OptionalBytesFieldNumber = 15;
    private pb::ByteString optionalBytes_ = pb::ByteString.Empty;
    public pb::ByteString OptionalBytes {
      get { return optionalBytes_; }
    }

    public const int OptionalNestedMessageFieldNumber = 18;
    private bool hasOptionalNestedMessage;
    private global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage optionalNestedMessage_;
    public bool HasOptionalNestedMessage {
      get { return hasOptionalNestedMessage; }
    }
    public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OptionalNestedMessage {
      get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance; }
    }

    public const int OptionalForeignMessageFieldNumber = 19;
    private bool hasOptionalForeignMessage;
    private global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage optionalForeignMessage_;
    public bool HasOptionalForeignMessage {
      get { return hasOptionalForeignMessage; }
    }
    public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage OptionalForeignMessage {
      get { return optionalForeignMessage_ ?? global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance; }
    }

    public const int OptionalProto2MessageFieldNumber = 20;
    private bool hasOptionalProto2Message;
    private global::Google.ProtocolBuffers.TestProtos.TestAllTypes optionalProto2Message_;
    public bool HasOptionalProto2Message {
      get { return hasOptionalProto2Message; }
    }
    public global::Google.ProtocolBuffers.TestProtos.TestAllTypes OptionalProto2Message {
      get { return optionalProto2Message_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance; }
    }

    public const int OptionalNestedEnumFieldNumber = 21;
    private global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO;
    public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum OptionalNestedEnum {
      get { return optionalNestedEnum_; }
    }

    public const int OptionalForeignEnumFieldNumber = 22;
    private global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO;
    public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum OptionalForeignEnum {
      get { return optionalForeignEnum_; }
    }

    public const int OptionalStringPieceFieldNumber = 24;
    private string optionalStringPiece_ = "";
    public string OptionalStringPiece {
      get { return optionalStringPiece_; }
    }

    public const int OptionalCordFieldNumber = 25;
    private string optionalCord_ = "";
    public string OptionalCord {
      get { return optionalCord_; }
    }

    public const int OptionalLazyMessageFieldNumber = 30;
    private bool hasOptionalLazyMessage;
    private global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage optionalLazyMessage_;
    public bool HasOptionalLazyMessage {
      get { return hasOptionalLazyMessage; }
    }
    public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OptionalLazyMessage {
      get { return optionalLazyMessage_ ?? global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance; }
    }

    public const int RepeatedInt32FieldNumber = 31;
    private int repeatedInt32MemoizedSerializedSize;
    private pbc::PopsicleList<int> repeatedInt32_ = new pbc::PopsicleList<int>();
    public scg::IList<int> RepeatedInt32List {
      get { return pbc::Lists.AsReadOnly(repeatedInt32_); }
    }
    public int RepeatedInt32Count {
      get { return repeatedInt32_.Count; }
    }
    public int GetRepeatedInt32(int index) {
      return repeatedInt32_[index];
    }

    public const int RepeatedInt64FieldNumber = 32;
    private int repeatedInt64MemoizedSerializedSize;
    private pbc::PopsicleList<long> repeatedInt64_ = new pbc::PopsicleList<long>();
    public scg::IList<long> RepeatedInt64List {
      get { return pbc::Lists.AsReadOnly(repeatedInt64_); }
    }
    public int RepeatedInt64Count {
      get { return repeatedInt64_.Count; }
    }
    public long GetRepeatedInt64(int index) {
      return repeatedInt64_[index];
    }

    public const int RepeatedUint32FieldNumber = 33;
    private int repeatedUint32MemoizedSerializedSize;
    private pbc::PopsicleList<uint> repeatedUint32_ = new pbc::PopsicleList<uint>();
    public scg::IList<uint> RepeatedUint32List {
      get { return pbc::Lists.AsReadOnly(repeatedUint32_); }
    }
    public int RepeatedUint32Count {
      get { return repeatedUint32_.Count; }
    }
    public uint GetRepeatedUint32(int index) {
      return repeatedUint32_[index];
    }

    public const int RepeatedUint64FieldNumber = 34;
    private int repeatedUint64MemoizedSerializedSize;
    private pbc::PopsicleList<ulong> repeatedUint64_ = new pbc::PopsicleList<ulong>();
    public scg::IList<ulong> RepeatedUint64List {
      get { return pbc::Lists.AsReadOnly(repeatedUint64_); }
    }
    public int RepeatedUint64Count {
      get { return repeatedUint64_.Count; }
    }
    public ulong GetRepeatedUint64(int index) {
      return repeatedUint64_[index];
    }

    public const int RepeatedSint32FieldNumber = 35;
    private int repeatedSint32MemoizedSerializedSize;
    private pbc::PopsicleList<int> repeatedSint32_ = new pbc::PopsicleList<int>();
    public scg::IList<int> RepeatedSint32List {
      get { return pbc::Lists.AsReadOnly(repeatedSint32_); }
    }
    public int RepeatedSint32Count {
      get { return repeatedSint32_.Count; }
    }
    public int GetRepeatedSint32(int index) {
      return repeatedSint32_[index];
    }

    public const int RepeatedSint64FieldNumber = 36;
    private int repeatedSint64MemoizedSerializedSize;
    private pbc::PopsicleList<long> repeatedSint64_ = new pbc::PopsicleList<long>();
    public scg::IList<long> RepeatedSint64List {
      get { return pbc::Lists.AsReadOnly(repeatedSint64_); }
    }
    public int RepeatedSint64Count {
      get { return repeatedSint64_.Count; }
    }
    public long GetRepeatedSint64(int index) {
      return repeatedSint64_[index];
    }

    public const int RepeatedFixed32FieldNumber = 37;
    private int repeatedFixed32MemoizedSerializedSize;
    private pbc::PopsicleList<uint> repeatedFixed32_ = new pbc::PopsicleList<uint>();
    public scg::IList<uint> RepeatedFixed32List {
      get { return pbc::Lists.AsReadOnly(repeatedFixed32_); }
    }
    public int RepeatedFixed32Count {
      get { return repeatedFixed32_.Count; }
    }
    public uint GetRepeatedFixed32(int index) {
      return repeatedFixed32_[index];
    }

    public const int RepeatedFixed64FieldNumber = 38;
    private int repeatedFixed64MemoizedSerializedSize;
    private pbc::PopsicleList<ulong> repeatedFixed64_ = new pbc::PopsicleList<ulong>();
    public scg::IList<ulong> RepeatedFixed64List {
      get { return pbc::Lists.AsReadOnly(repeatedFixed64_); }
    }
    public int RepeatedFixed64Count {
      get { return repeatedFixed64_.Count; }
    }
    public ulong GetRepeatedFixed64(int index) {
      return repeatedFixed64_[index];
    }

    public const int RepeatedSfixed32FieldNumber = 39;
    private int repeatedSfixed32MemoizedSerializedSize;
    private pbc::PopsicleList<int> repeatedSfixed32_ = new pbc::PopsicleList<int>();
    public scg::IList<int> RepeatedSfixed32List {
      get { return pbc::Lists.AsReadOnly(repeatedSfixed32_); }
    }
    public int RepeatedSfixed32Count {
      get { return repeatedSfixed32_.Count; }
    }
    public int GetRepeatedSfixed32(int index) {
      return repeatedSfixed32_[index];
    }

    public const int RepeatedSfixed64FieldNumber = 40;
    private int repeatedSfixed64MemoizedSerializedSize;
    private pbc::PopsicleList<long> repeatedSfixed64_ = new pbc::PopsicleList<long>();
    public scg::IList<long> RepeatedSfixed64List {
      get { return pbc::Lists.AsReadOnly(repeatedSfixed64_); }
    }
    public int RepeatedSfixed64Count {
      get { return repeatedSfixed64_.Count; }
    }
    public long GetRepeatedSfixed64(int index) {
      return repeatedSfixed64_[index];
    }

    public const int RepeatedFloatFieldNumber = 41;
    private int repeatedFloatMemoizedSerializedSize;
    private pbc::PopsicleList<float> repeatedFloat_ = new pbc::PopsicleList<float>();
    public scg::IList<float> RepeatedFloatList {
      get { return pbc::Lists.AsReadOnly(repeatedFloat_); }
    }
    public int RepeatedFloatCount {
      get { return repeatedFloat_.Count; }
    }
    public float GetRepeatedFloat(int index) {
      return repeatedFloat_[index];
    }

    public const int RepeatedDoubleFieldNumber = 42;
    private int repeatedDoubleMemoizedSerializedSize;
    private pbc::PopsicleList<double> repeatedDouble_ = new pbc::PopsicleList<double>();
    public scg::IList<double> RepeatedDoubleList {
      get { return pbc::Lists.AsReadOnly(repeatedDouble_); }
    }
    public int RepeatedDoubleCount {
      get { return repeatedDouble_.Count; }
    }
    public double GetRepeatedDouble(int index) {
      return repeatedDouble_[index];
    }

    public const int RepeatedBoolFieldNumber = 43;
    private int repeatedBoolMemoizedSerializedSize;
    private pbc::PopsicleList<bool> repeatedBool_ = new pbc::PopsicleList<bool>();
    public scg::IList<bool> RepeatedBoolList {
      get { return pbc::Lists.AsReadOnly(repeatedBool_); }
    }
    public int RepeatedBoolCount {
      get { return repeatedBool_.Count; }
    }
    public bool GetRepeatedBool(int index) {
      return repeatedBool_[index];
    }

    public const int RepeatedStringFieldNumber = 44;
    private pbc::PopsicleList<string> repeatedString_ = new pbc::PopsicleList<string>();
    public scg::IList<string> RepeatedStringList {
      get { return pbc::Lists.AsReadOnly(repeatedString_); }
    }
    public int RepeatedStringCount {
      get { return repeatedString_.Count; }
    }
    public string GetRepeatedString(int index) {
      return repeatedString_[index];
    }

    public const int RepeatedBytesFieldNumber = 45;
    private pbc::PopsicleList<pb::ByteString> repeatedBytes_ = new pbc::PopsicleList<pb::ByteString>();
    public scg::IList<pb::ByteString> RepeatedBytesList {
      get { return pbc::Lists.AsReadOnly(repeatedBytes_); }
    }
    public int RepeatedBytesCount {
      get { return repeatedBytes_.Count; }
    }
    public pb::ByteString GetRepeatedBytes(int index) {
      return repeatedBytes_[index];
    }

    public const int RepeatedNestedMessageFieldNumber = 48;
    private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> repeatedNestedMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage>();
    public scg::IList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> RepeatedNestedMessageList {
      get { return repeatedNestedMessage_; }
    }
    public int RepeatedNestedMessageCount {
      get { return repeatedNestedMessage_.Count; }
    }
    public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) {
      return repeatedNestedMessage_[index];
    }

    public const int RepeatedForeignMessageFieldNumber = 49;
    private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage> repeatedForeignMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage>();
    public scg::IList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage> RepeatedForeignMessageList {
      get { return repeatedForeignMessage_; }
    }
    public int RepeatedForeignMessageCount {
      get { return repeatedForeignMessage_.Count; }
    }
    public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage GetRepeatedForeignMessage(int index) {
      return repeatedForeignMessage_[index];
    }

    public const int RepeatedProto2MessageFieldNumber = 50;
    private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> repeatedProto2Message_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes>();
    public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> RepeatedProto2MessageList {
      get { return repeatedProto2Message_; }
    }
    public int RepeatedProto2MessageCount {
      get { return repeatedProto2Message_.Count; }
    }
    public global::Google.ProtocolBuffers.TestProtos.TestAllTypes GetRepeatedProto2Message(int index) {
      return repeatedProto2Message_[index];
    }

    public const int RepeatedNestedEnumFieldNumber = 51;
    private int repeatedNestedEnumMemoizedSerializedSize;
    private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum> repeatedNestedEnum_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum>();
    public scg::IList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum> RepeatedNestedEnumList {
      get { return pbc::Lists.AsReadOnly(repeatedNestedEnum_); }
    }
    public int RepeatedNestedEnumCount {
      get { return repeatedNestedEnum_.Count; }
    }
    public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) {
      return repeatedNestedEnum_[index];
    }

    public const int RepeatedForeignEnumFieldNumber = 52;
    private int repeatedForeignEnumMemoizedSerializedSize;
    private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum> repeatedForeignEnum_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum>();
    public scg::IList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum> RepeatedForeignEnumList {
      get { return pbc::Lists.AsReadOnly(repeatedForeignEnum_); }
    }
    public int RepeatedForeignEnumCount {
      get { return repeatedForeignEnum_.Count; }
    }
    public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum GetRepeatedForeignEnum(int index) {
      return repeatedForeignEnum_[index];
    }

    public const int RepeatedStringPieceFieldNumber = 54;
    private pbc::PopsicleList<string> repeatedStringPiece_ = new pbc::PopsicleList<string>();
    public scg::IList<string> RepeatedStringPieceList {
      get { return pbc::Lists.AsReadOnly(repeatedStringPiece_); }
    }
    public int RepeatedStringPieceCount {
      get { return repeatedStringPiece_.Count; }
    }
    public string GetRepeatedStringPiece(int index) {
      return repeatedStringPiece_[index];
    }

    public const int RepeatedCordFieldNumber = 55;
    private pbc::PopsicleList<string> repeatedCord_ = new pbc::PopsicleList<string>();
    public scg::IList<string> RepeatedCordList {
      get { return pbc::Lists.AsReadOnly(repeatedCord_); }
    }
    public int RepeatedCordCount {
      get { return repeatedCord_.Count; }
    }
    public string GetRepeatedCord(int index) {
      return repeatedCord_[index];
    }

    public const int RepeatedLazyMessageFieldNumber = 57;
    private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> repeatedLazyMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage>();
    public scg::IList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> RepeatedLazyMessageList {
      get { return repeatedLazyMessage_; }
    }
    public int RepeatedLazyMessageCount {
      get { return repeatedLazyMessage_.Count; }
    }
    public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage GetRepeatedLazyMessage(int index) {
      return repeatedLazyMessage_[index];
    }

    public const int OneofUint32FieldNumber = 111;
    public uint OneofUint32 {
      get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32 ? (uint) oneofField_ : 0; }
    }

    public const int OneofNestedMessageFieldNumber = 112;
    public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OneofNestedMessage {
      get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage) oneofField_ : global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance; }
    }

    public const int OneofStringFieldNumber = 113;
    public string OneofString {
      get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) oneofField_ : ""; }
    }

    public const int OneofEnumFieldNumber = 114;
    public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum OneofEnum {
      get { return oneofFieldCase_ == OneofFieldOneofCase.OneofEnum ? (global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum) oneofField_ : global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO; }
    }

    public override void WriteTo(pb::ICodedOutputStream output) {
      CalcSerializedSize();
      string[] field_names = _testAllTypesFieldNames;
      if (OptionalInt32 != 0) {
        output.WriteInt32(1, field_names[13], OptionalInt32);
      }
      if (OptionalInt64 != 0L) {
        output.WriteInt64(2, field_names[14], OptionalInt64);
      }
      if (OptionalUint32 != 0) {
        output.WriteUInt32(3, field_names[25], OptionalUint32);
      }
      if (OptionalUint64 != 0UL) {
        output.WriteUInt64(4, field_names[26], OptionalUint64);
      }
      if (OptionalSint32 != 0) {
        output.WriteSInt32(5, field_names[21], OptionalSint32);
      }
      if (OptionalSint64 != 0L) {
        output.WriteSInt64(6, field_names[22], OptionalSint64);
      }
      if (OptionalFixed32 != 0) {
        output.WriteFixed32(7, field_names[8], OptionalFixed32);
      }
      if (OptionalFixed64 != 0UL) {
        output.WriteFixed64(8, field_names[9], OptionalFixed64);
      }
      if (OptionalSfixed32 != 0) {
        output.WriteSFixed32(9, field_names[19], OptionalSfixed32);
      }
      if (OptionalSfixed64 != 0L) {
        output.WriteSFixed64(10, field_names[20], OptionalSfixed64);
      }
      if (OptionalFloat != 0F) {
        output.WriteFloat(11, field_names[10], OptionalFloat);
      }
      if (OptionalDouble != 0D) {
        output.WriteDouble(12, field_names[7], OptionalDouble);
      }
      if (OptionalBool != false) {
        output.WriteBool(13, field_names[4], OptionalBool);
      }
      if (OptionalString != "") {
        output.WriteString(14, field_names[23], OptionalString);
      }
      if (OptionalBytes != pb::ByteString.Empty) {
        output.WriteBytes(15, field_names[5], OptionalBytes);
      }
      if (hasOptionalNestedMessage) {
        output.WriteMessage(18, field_names[17], OptionalNestedMessage);
      }
      if (hasOptionalForeignMessage) {
        output.WriteMessage(19, field_names[12], OptionalForeignMessage);
      }
      if (hasOptionalProto2Message) {
        output.WriteMessage(20, field_names[18], OptionalProto2Message);
      }
      if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) {
        output.WriteEnum(21, field_names[16], (int) OptionalNestedEnum, OptionalNestedEnum);
      }
      if (OptionalForeignEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO) {
        output.WriteEnum(22, field_names[11], (int) OptionalForeignEnum, OptionalForeignEnum);
      }
      if (OptionalStringPiece != "") {
        output.WriteString(24, field_names[24], OptionalStringPiece);
      }
      if (OptionalCord != "") {
        output.WriteString(25, field_names[6], OptionalCord);
      }
      if (hasOptionalLazyMessage) {
        output.WriteMessage(30, field_names[15], OptionalLazyMessage);
      }
      if (repeatedInt32_.Count > 0) {
        output.WritePackedInt32Array(31, field_names[36], repeatedInt32MemoizedSerializedSize, repeatedInt32_);
      }
      if (repeatedInt64_.Count > 0) {
        output.WritePackedInt64Array(32, field_names[37], repeatedInt64MemoizedSerializedSize, repeatedInt64_);
      }
      if (repeatedUint32_.Count > 0) {
        output.WritePackedUInt32Array(33, field_names[48], repeatedUint32MemoizedSerializedSize, repeatedUint32_);
      }
      if (repeatedUint64_.Count > 0) {
        output.WritePackedUInt64Array(34, field_names[49], repeatedUint64MemoizedSerializedSize, repeatedUint64_);
      }
      if (repeatedSint32_.Count > 0) {
        output.WritePackedSInt32Array(35, field_names[44], repeatedSint32MemoizedSerializedSize, repeatedSint32_);
      }
      if (repeatedSint64_.Count > 0) {
        output.WritePackedSInt64Array(36, field_names[45], repeatedSint64MemoizedSerializedSize, repeatedSint64_);
      }
      if (repeatedFixed32_.Count > 0) {
        output.WritePackedFixed32Array(37, field_names[31], repeatedFixed32MemoizedSerializedSize, repeatedFixed32_);
      }
      if (repeatedFixed64_.Count > 0) {
        output.WritePackedFixed64Array(38, field_names[32], repeatedFixed64MemoizedSerializedSize, repeatedFixed64_);
      }
      if (repeatedSfixed32_.Count > 0) {
        output.WritePackedSFixed32Array(39, field_names[42], repeatedSfixed32MemoizedSerializedSize, repeatedSfixed32_);
      }
      if (repeatedSfixed64_.Count > 0) {
        output.WritePackedSFixed64Array(40, field_names[43], repeatedSfixed64MemoizedSerializedSize, repeatedSfixed64_);
      }
      if (repeatedFloat_.Count > 0) {
        output.WritePackedFloatArray(41, field_names[33], repeatedFloatMemoizedSerializedSize, repeatedFloat_);
      }
      if (repeatedDouble_.Count > 0) {
        output.WritePackedDoubleArray(42, field_names[30], repeatedDoubleMemoizedSerializedSize, repeatedDouble_);
      }
      if (repeatedBool_.Count > 0) {
        output.WritePackedBoolArray(43, field_names[27], repeatedBoolMemoizedSerializedSize, repeatedBool_);
      }
      if (repeatedString_.Count > 0) {
        output.WriteStringArray(44, field_names[46], repeatedString_);
      }
      if (repeatedBytes_.Count > 0) {
        output.WriteBytesArray(45, field_names[28], repeatedBytes_);
      }
      if (repeatedNestedMessage_.Count > 0) {
        output.WriteMessageArray(48, field_names[40], repeatedNestedMessage_);
      }
      if (repeatedForeignMessage_.Count > 0) {
        output.WriteMessageArray(49, field_names[35], repeatedForeignMessage_);
      }
      if (repeatedProto2Message_.Count > 0) {
        output.WriteMessageArray(50, field_names[41], repeatedProto2Message_);
      }
      if (repeatedNestedEnum_.Count > 0) {
        output.WritePackedEnumArray(51, field_names[39], repeatedNestedEnumMemoizedSerializedSize, repeatedNestedEnum_);
      }
      if (repeatedForeignEnum_.Count > 0) {
        output.WritePackedEnumArray(52, field_names[34], repeatedForeignEnumMemoizedSerializedSize, repeatedForeignEnum_);
      }
      if (repeatedStringPiece_.Count > 0) {
        output.WriteStringArray(54, field_names[47], repeatedStringPiece_);
      }
      if (repeatedCord_.Count > 0) {
        output.WriteStringArray(55, field_names[29], repeatedCord_);
      }
      if (repeatedLazyMessage_.Count > 0) {
        output.WriteMessageArray(57, field_names[38], repeatedLazyMessage_);
      }
      if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) {
        output.WriteUInt32(111, field_names[3], OneofUint32);
      }
      if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) {
        output.WriteMessage(112, field_names[1], OneofNestedMessage);
      }
      if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) {
        output.WriteString(113, field_names[2], OneofString);
      }
      if (oneofFieldCase_ == OneofFieldOneofCase.OneofEnum) {
        output.WriteEnum(114, field_names[0], (int) OneofEnum, OneofEnum);
      }
      UnknownFields.WriteTo(output);
    }

    private int memoizedSerializedSize = -1;
    public override int SerializedSize {
      get {
        int size = memoizedSerializedSize;
        if (size != -1) return size;
        return CalcSerializedSize();
      }
    }

    private int CalcSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (OptionalInt32 != 0) {
        size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32);
      }
      if (OptionalInt64 != 0L) {
        size += pb::CodedOutputStream.ComputeInt64Size(2, OptionalInt64);
      }
      if (OptionalUint32 != 0) {
        size += pb::CodedOutputStream.ComputeUInt32Size(3, OptionalUint32);
      }
      if (OptionalUint64 != 0UL) {
        size += pb::CodedOutputStream.ComputeUInt64Size(4, OptionalUint64);
      }
      if (OptionalSint32 != 0) {
        size += pb::CodedOutputStream.ComputeSInt32Size(5, OptionalSint32);
      }
      if (OptionalSint64 != 0L) {
        size += pb::CodedOutputStream.ComputeSInt64Size(6, OptionalSint64);
      }
      if (OptionalFixed32 != 0) {
        size += pb::CodedOutputStream.ComputeFixed32Size(7, OptionalFixed32);
      }
      if (OptionalFixed64 != 0UL) {
        size += pb::CodedOutputStream.ComputeFixed64Size(8, OptionalFixed64);
      }
      if (OptionalSfixed32 != 0) {
        size += pb::CodedOutputStream.ComputeSFixed32Size(9, OptionalSfixed32);
      }
      if (OptionalSfixed64 != 0L) {
        size += pb::CodedOutputStream.ComputeSFixed64Size(10, OptionalSfixed64);
      }
      if (OptionalFloat != 0F) {
        size += pb::CodedOutputStream.ComputeFloatSize(11, OptionalFloat);
      }
      if (OptionalDouble != 0D) {
        size += pb::CodedOutputStream.ComputeDoubleSize(12, OptionalDouble);
      }
      if (OptionalBool != false) {
        size += pb::CodedOutputStream.ComputeBoolSize(13, OptionalBool);
      }
      if (OptionalString != "") {
        size += pb::CodedOutputStream.ComputeStringSize(14, OptionalString);
      }
      if (OptionalBytes != pb::ByteString.Empty) {
        size += pb::CodedOutputStream.ComputeBytesSize(15, OptionalBytes);
      }
      if (hasOptionalNestedMessage) {
        size += pb::CodedOutputStream.ComputeMessageSize(18, OptionalNestedMessage);
      }
      if (hasOptionalForeignMessage) {
        size += pb::CodedOutputStream.ComputeMessageSize(19, OptionalForeignMessage);
      }
      if (hasOptionalProto2Message) {
        size += pb::CodedOutputStream.ComputeMessageSize(20, OptionalProto2Message);
      }
      if (OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) {
        size += pb::CodedOutputStream.ComputeEnumSize(21, (int) OptionalNestedEnum);
      }
      if (OptionalForeignEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO) {
        size += pb::CodedOutputStream.ComputeEnumSize(22, (int) OptionalForeignEnum);
      }
      if (OptionalStringPiece != "") {
        size += pb::CodedOutputStream.ComputeStringSize(24, OptionalStringPiece);
      }
      if (OptionalCord != "") {
        size += pb::CodedOutputStream.ComputeStringSize(25, OptionalCord);
      }
      if (hasOptionalLazyMessage) {
        size += pb::CodedOutputStream.ComputeMessageSize(30, OptionalLazyMessage);
      }
      {
        int dataSize = 0;
        foreach (int element in RepeatedInt32List) {
          dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element);
        }
        size += dataSize;
        if (repeatedInt32_.Count != 0) {
          size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
        }
        repeatedInt32MemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        foreach (long element in RepeatedInt64List) {
          dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element);
        }
        size += dataSize;
        if (repeatedInt64_.Count != 0) {
          size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
        }
        repeatedInt64MemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        foreach (uint element in RepeatedUint32List) {
          dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element);
        }
        size += dataSize;
        if (repeatedUint32_.Count != 0) {
          size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
        }
        repeatedUint32MemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        foreach (ulong element in RepeatedUint64List) {
          dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element);
        }
        size += dataSize;
        if (repeatedUint64_.Count != 0) {
          size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
        }
        repeatedUint64MemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        foreach (int element in RepeatedSint32List) {
          dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element);
        }
        size += dataSize;
        if (repeatedSint32_.Count != 0) {
          size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
        }
        repeatedSint32MemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        foreach (long element in RepeatedSint64List) {
          dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element);
        }
        size += dataSize;
        if (repeatedSint64_.Count != 0) {
          size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
        }
        repeatedSint64MemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        dataSize = 4 * repeatedFixed32_.Count;
        size += dataSize;
        if (repeatedFixed32_.Count != 0) {
          size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
        }
        repeatedFixed32MemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        dataSize = 8 * repeatedFixed64_.Count;
        size += dataSize;
        if (repeatedFixed64_.Count != 0) {
          size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
        }
        repeatedFixed64MemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        dataSize = 4 * repeatedSfixed32_.Count;
        size += dataSize;
        if (repeatedSfixed32_.Count != 0) {
          size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
        }
        repeatedSfixed32MemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        dataSize = 8 * repeatedSfixed64_.Count;
        size += dataSize;
        if (repeatedSfixed64_.Count != 0) {
          size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
        }
        repeatedSfixed64MemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        dataSize = 4 * repeatedFloat_.Count;
        size += dataSize;
        if (repeatedFloat_.Count != 0) {
          size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
        }
        repeatedFloatMemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        dataSize = 8 * repeatedDouble_.Count;
        size += dataSize;
        if (repeatedDouble_.Count != 0) {
          size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
        }
        repeatedDoubleMemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        dataSize = 1 * repeatedBool_.Count;
        size += dataSize;
        if (repeatedBool_.Count != 0) {
          size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
        }
        repeatedBoolMemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        foreach (string element in RepeatedStringList) {
          dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
        }
        size += dataSize;
        size += 2 * repeatedString_.Count;
      }
      {
        int dataSize = 0;
        foreach (pb::ByteString element in RepeatedBytesList) {
          dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element);
        }
        size += dataSize;
        size += 2 * repeatedBytes_.Count;
      }
      foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage element in RepeatedNestedMessageList) {
        size += pb::CodedOutputStream.ComputeMessageSize(48, element);
      }
      foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage element in RepeatedForeignMessageList) {
        size += pb::CodedOutputStream.ComputeMessageSize(49, element);
      }
      foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes element in RepeatedProto2MessageList) {
        size += pb::CodedOutputStream.ComputeMessageSize(50, element);
      }
      {
        int dataSize = 0;
        if (repeatedNestedEnum_.Count > 0) {
          foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum element in repeatedNestedEnum_) {
            dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
          }
          size += dataSize;
          size += 2;
          size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
        }
        repeatedNestedEnumMemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        if (repeatedForeignEnum_.Count > 0) {
          foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum element in repeatedForeignEnum_) {
            dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
          }
          size += dataSize;
          size += 2;
          size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
        }
        repeatedForeignEnumMemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        foreach (string element in RepeatedStringPieceList) {
          dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
        }
        size += dataSize;
        size += 2 * repeatedStringPiece_.Count;
      }
      {
        int dataSize = 0;
        foreach (string element in RepeatedCordList) {
          dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
        }
        size += dataSize;
        size += 2 * repeatedCord_.Count;
      }
      foreach (global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage element in RepeatedLazyMessageList) {
        size += pb::CodedOutputStream.ComputeMessageSize(57, element);
      }
      if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) {
        size += pb::CodedOutputStream.ComputeUInt32Size(111, OneofUint32);
      }
      if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) {
        size += pb::CodedOutputStream.ComputeMessageSize(112, OneofNestedMessage);
      }
      if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) {
        size += pb::CodedOutputStream.ComputeStringSize(113, OneofString);
      }
      if (oneofFieldCase_ == OneofFieldOneofCase.OneofEnum) {
        size += pb::CodedOutputStream.ComputeEnumSize(114, (int) OneofEnum);
      }
      size += UnknownFields.SerializedSize;
      memoizedSerializedSize = size;
      return size;
    }
    public static TestAllTypes ParseFrom(pb::ByteString data) {
      return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
    }
    public static TestAllTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
    }
    public static TestAllTypes ParseFrom(byte[] data) {
      return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
    }
    public static TestAllTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
    }
    public static TestAllTypes ParseFrom(global::System.IO.Stream input) {
      return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
    }
    public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
    }
    public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) {
      return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
    }
    public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
      return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
    }
    public static TestAllTypes ParseFrom(pb::ICodedInputStream input) {
      return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
    }
    public static TestAllTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
    }
    private TestAllTypes MakeReadOnly() {
      repeatedInt32_.MakeReadOnly();
      repeatedInt64_.MakeReadOnly();
      repeatedUint32_.MakeReadOnly();
      repeatedUint64_.MakeReadOnly();
      repeatedSint32_.MakeReadOnly();
      repeatedSint64_.MakeReadOnly();
      repeatedFixed32_.MakeReadOnly();
      repeatedFixed64_.MakeReadOnly();
      repeatedSfixed32_.MakeReadOnly();
      repeatedSfixed64_.MakeReadOnly();
      repeatedFloat_.MakeReadOnly();
      repeatedDouble_.MakeReadOnly();
      repeatedBool_.MakeReadOnly();
      repeatedString_.MakeReadOnly();
      repeatedBytes_.MakeReadOnly();
      repeatedNestedMessage_.MakeReadOnly();
      repeatedForeignMessage_.MakeReadOnly();
      repeatedProto2Message_.MakeReadOnly();
      repeatedNestedEnum_.MakeReadOnly();
      repeatedForeignEnum_.MakeReadOnly();
      repeatedStringPiece_.MakeReadOnly();
      repeatedCord_.MakeReadOnly();
      repeatedLazyMessage_.MakeReadOnly();
      return this;
    }

    public static Builder CreateBuilder() { return new Builder(); }
    public override Builder ToBuilder() { return CreateBuilder(this); }
    public override Builder CreateBuilderForType() { return new Builder(); }
    public static Builder CreateBuilder(TestAllTypes prototype) {
      return new Builder(prototype);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    public sealed partial class Builder : pb::GeneratedBuilder<TestAllTypes, Builder> {
      protected override Builder ThisBuilder {
        get { return this; }
      }
      public Builder() {
        result = DefaultInstance;
        resultIsReadOnly = true;
      }
      internal Builder(TestAllTypes cloneFrom) {
        result = cloneFrom;
        resultIsReadOnly = true;
      }

      private bool resultIsReadOnly;
      private TestAllTypes result;

      private TestAllTypes PrepareBuilder() {
        if (resultIsReadOnly) {
          TestAllTypes original = result;
          result = new TestAllTypes();
          resultIsReadOnly = false;
          MergeFrom(original);
        }
        return result;
      }

      public override bool IsInitialized {
        get { return result.IsInitialized; }
      }

      protected override TestAllTypes MessageBeingBuilt {
        get { return PrepareBuilder(); }
      }

      public override Builder Clear() {
        result = DefaultInstance;
        resultIsReadOnly = true;
        return this;
      }

      public override Builder Clone() {
        if (resultIsReadOnly) {
          return new Builder(result);
        } else {
          return new Builder().MergeFrom(result);
        }
      }

      public override pbd::MessageDescriptor DescriptorForType {
        get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Descriptor; }
      }

      public override TestAllTypes DefaultInstanceForType {
        get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.DefaultInstance; }
      }

      public override TestAllTypes BuildPartial() {
        if (resultIsReadOnly) {
          return result;
        }
        resultIsReadOnly = true;
        return result.MakeReadOnly();
      }

      public override Builder MergeFrom(pb::IMessage other) {
        if (other is TestAllTypes) {
          return MergeFrom((TestAllTypes) other);
        } else {
          base.MergeFrom(other);
          return this;
        }
      }

      public override Builder MergeFrom(TestAllTypes other) {
        if (other == global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.DefaultInstance) return this;
        PrepareBuilder();
        if (other.OptionalInt32 != 0) {
          OptionalInt32 = other.OptionalInt32;
        }
        if (other.OptionalInt64 != 0L) {
          OptionalInt64 = other.OptionalInt64;
        }
        if (other.OptionalUint32 != 0) {
          OptionalUint32 = other.OptionalUint32;
        }
        if (other.OptionalUint64 != 0UL) {
          OptionalUint64 = other.OptionalUint64;
        }
        if (other.OptionalSint32 != 0) {
          OptionalSint32 = other.OptionalSint32;
        }
        if (other.OptionalSint64 != 0L) {
          OptionalSint64 = other.OptionalSint64;
        }
        if (other.OptionalFixed32 != 0) {
          OptionalFixed32 = other.OptionalFixed32;
        }
        if (other.OptionalFixed64 != 0UL) {
          OptionalFixed64 = other.OptionalFixed64;
        }
        if (other.OptionalSfixed32 != 0) {
          OptionalSfixed32 = other.OptionalSfixed32;
        }
        if (other.OptionalSfixed64 != 0L) {
          OptionalSfixed64 = other.OptionalSfixed64;
        }
        if (other.OptionalFloat != 0F) {
          OptionalFloat = other.OptionalFloat;
        }
        if (other.OptionalDouble != 0D) {
          OptionalDouble = other.OptionalDouble;
        }
        if (other.OptionalBool != false) {
          OptionalBool = other.OptionalBool;
        }
        if (other.OptionalString != "") {
          OptionalString = other.OptionalString;
        }
        if (other.OptionalBytes != pb::ByteString.Empty) {
          OptionalBytes = other.OptionalBytes;
        }
        if (other.HasOptionalNestedMessage) {
          MergeOptionalNestedMessage(other.OptionalNestedMessage);
        }
        if (other.HasOptionalForeignMessage) {
          MergeOptionalForeignMessage(other.OptionalForeignMessage);
        }
        if (other.HasOptionalProto2Message) {
          MergeOptionalProto2Message(other.OptionalProto2Message);
        }
        if (other.OptionalNestedEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO) {
          OptionalNestedEnum = other.OptionalNestedEnum;
        }
        if (other.OptionalForeignEnum != global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO) {
          OptionalForeignEnum = other.OptionalForeignEnum;
        }
        if (other.OptionalStringPiece != "") {
          OptionalStringPiece = other.OptionalStringPiece;
        }
        if (other.OptionalCord != "") {
          OptionalCord = other.OptionalCord;
        }
        if (other.HasOptionalLazyMessage) {
          MergeOptionalLazyMessage(other.OptionalLazyMessage);
        }
        if (other.repeatedInt32_.Count != 0) {
          result.repeatedInt32_.Add(other.repeatedInt32_);
        }
        if (other.repeatedInt64_.Count != 0) {
          result.repeatedInt64_.Add(other.repeatedInt64_);
        }
        if (other.repeatedUint32_.Count != 0) {
          result.repeatedUint32_.Add(other.repeatedUint32_);
        }
        if (other.repeatedUint64_.Count != 0) {
          result.repeatedUint64_.Add(other.repeatedUint64_);
        }
        if (other.repeatedSint32_.Count != 0) {
          result.repeatedSint32_.Add(other.repeatedSint32_);
        }
        if (other.repeatedSint64_.Count != 0) {
          result.repeatedSint64_.Add(other.repeatedSint64_);
        }
        if (other.repeatedFixed32_.Count != 0) {
          result.repeatedFixed32_.Add(other.repeatedFixed32_);
        }
        if (other.repeatedFixed64_.Count != 0) {
          result.repeatedFixed64_.Add(other.repeatedFixed64_);
        }
        if (other.repeatedSfixed32_.Count != 0) {
          result.repeatedSfixed32_.Add(other.repeatedSfixed32_);
        }
        if (other.repeatedSfixed64_.Count != 0) {
          result.repeatedSfixed64_.Add(other.repeatedSfixed64_);
        }
        if (other.repeatedFloat_.Count != 0) {
          result.repeatedFloat_.Add(other.repeatedFloat_);
        }
        if (other.repeatedDouble_.Count != 0) {
          result.repeatedDouble_.Add(other.repeatedDouble_);
        }
        if (other.repeatedBool_.Count != 0) {
          result.repeatedBool_.Add(other.repeatedBool_);
        }
        if (other.repeatedString_.Count != 0) {
          result.repeatedString_.Add(other.repeatedString_);
        }
        if (other.repeatedBytes_.Count != 0) {
          result.repeatedBytes_.Add(other.repeatedBytes_);
        }
        if (other.repeatedNestedMessage_.Count != 0) {
          result.repeatedNestedMessage_.Add(other.repeatedNestedMessage_);
        }
        if (other.repeatedForeignMessage_.Count != 0) {
          result.repeatedForeignMessage_.Add(other.repeatedForeignMessage_);
        }
        if (other.repeatedProto2Message_.Count != 0) {
          result.repeatedProto2Message_.Add(other.repeatedProto2Message_);
        }
        if (other.repeatedNestedEnum_.Count != 0) {
          result.repeatedNestedEnum_.Add(other.repeatedNestedEnum_);
        }
        if (other.repeatedForeignEnum_.Count != 0) {
          result.repeatedForeignEnum_.Add(other.repeatedForeignEnum_);
        }
        if (other.repeatedStringPiece_.Count != 0) {
          result.repeatedStringPiece_.Add(other.repeatedStringPiece_);
        }
        if (other.repeatedCord_.Count != 0) {
          result.repeatedCord_.Add(other.repeatedCord_);
        }
        if (other.repeatedLazyMessage_.Count != 0) {
          result.repeatedLazyMessage_.Add(other.repeatedLazyMessage_);
        }
        switch (other.OneofFieldCase) {
          case OneofFieldOneofCase.OneofUint32: {
            SetOneofUint32(other.OneofUint32);
            break;
          }
          case OneofFieldOneofCase.OneofNestedMessage: {
            MergeOneofNestedMessage(other.OneofNestedMessage);
            break;
          }
          case OneofFieldOneofCase.OneofString: {
            SetOneofString(other.OneofString);
            break;
          }
          case OneofFieldOneofCase.OneofEnum: {
            SetOneofEnum(other.OneofEnum);
            break;
          }
          case OneofFieldOneofCase.None: { break; }
        }
        this.MergeUnknownFields(other.UnknownFields);
        return this;
      }

      public override Builder MergeFrom(pb::ICodedInputStream input) {
        return MergeFrom(input, pb::ExtensionRegistry.Empty);
      }

      public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
        PrepareBuilder();
        pb::UnknownFieldSet.Builder unknownFields = null;
        uint tag;
        string field_name;
        while (input.ReadTag(out tag, out field_name)) {
          if(tag == 0 && field_name != null) {
            int field_ordinal = global::System.Array.BinarySearch(_testAllTypesFieldNames, field_name, global::System.StringComparer.Ordinal);
            if(field_ordinal >= 0)
              tag = _testAllTypesFieldTags[field_ordinal];
            else {
              if (unknownFields == null) {
                unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
              }
              ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
              continue;
            }
          }
          switch (tag) {
            case 0: {
              throw pb::InvalidProtocolBufferException.InvalidTag();
            }
            default: {
              if (pb::WireFormat.IsEndGroupTag(tag)) {
                if (unknownFields != null) {
                  this.UnknownFields = unknownFields.Build();
                }
                return this;
              }
              if (unknownFields == null) {
                unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
              }
              ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
              break;
            }
            case 8: {
              input.ReadInt32(ref result.optionalInt32_);
              break;
            }
            case 16: {
              input.ReadInt64(ref result.optionalInt64_);
              break;
            }
            case 24: {
              input.ReadUInt32(ref result.optionalUint32_);
              break;
            }
            case 32: {
              input.ReadUInt64(ref result.optionalUint64_);
              break;
            }
            case 40: {
              input.ReadSInt32(ref result.optionalSint32_);
              break;
            }
            case 48: {
              input.ReadSInt64(ref result.optionalSint64_);
              break;
            }
            case 61: {
              input.ReadFixed32(ref result.optionalFixed32_);
              break;
            }
            case 65: {
              input.ReadFixed64(ref result.optionalFixed64_);
              break;
            }
            case 77: {
              input.ReadSFixed32(ref result.optionalSfixed32_);
              break;
            }
            case 81: {
              input.ReadSFixed64(ref result.optionalSfixed64_);
              break;
            }
            case 93: {
              input.ReadFloat(ref result.optionalFloat_);
              break;
            }
            case 97: {
              input.ReadDouble(ref result.optionalDouble_);
              break;
            }
            case 104: {
              input.ReadBool(ref result.optionalBool_);
              break;
            }
            case 114: {
              input.ReadString(ref result.optionalString_);
              break;
            }
            case 122: {
              input.ReadBytes(ref result.optionalBytes_);
              break;
            }
            case 146: {
              global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder();
              if (result.hasOptionalNestedMessage) {
                subBuilder.MergeFrom(OptionalNestedMessage);
              }
              input.ReadMessage(subBuilder, extensionRegistry);
              OptionalNestedMessage = subBuilder.BuildPartial();
              break;
            }
            case 154: {
              global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.CreateBuilder();
              if (result.hasOptionalForeignMessage) {
                subBuilder.MergeFrom(OptionalForeignMessage);
              }
              input.ReadMessage(subBuilder, extensionRegistry);
              OptionalForeignMessage = subBuilder.BuildPartial();
              break;
            }
            case 162: {
              global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder();
              if (result.hasOptionalProto2Message) {
                subBuilder.MergeFrom(OptionalProto2Message);
              }
              input.ReadMessage(subBuilder, extensionRegistry);
              OptionalProto2Message = subBuilder.BuildPartial();
              break;
            }
            case 168: {
              object unknown;
              if(input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) {
              } else if(unknown is int) {
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                unknownFields.MergeVarintField(21, (ulong)(int)unknown);
              }
              break;
            }
            case 176: {
              object unknown;
              if(input.ReadEnum(ref result.optionalForeignEnum_, out unknown)) {
              } else if(unknown is int) {
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                unknownFields.MergeVarintField(22, (ulong)(int)unknown);
              }
              break;
            }
            case 194: {
              input.ReadString(ref result.optionalStringPiece_);
              break;
            }
            case 202: {
              input.ReadString(ref result.optionalCord_);
              break;
            }
            case 242: {
              global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder();
              if (result.hasOptionalLazyMessage) {
                subBuilder.MergeFrom(OptionalLazyMessage);
              }
              input.ReadMessage(subBuilder, extensionRegistry);
              OptionalLazyMessage = subBuilder.BuildPartial();
              break;
            }
            case 250:
            case 248: {
              input.ReadInt32Array(tag, field_name, result.repeatedInt32_);
              break;
            }
            case 258:
            case 256: {
              input.ReadInt64Array(tag, field_name, result.repeatedInt64_);
              break;
            }
            case 266:
            case 264: {
              input.ReadUInt32Array(tag, field_name, result.repeatedUint32_);
              break;
            }
            case 274:
            case 272: {
              input.ReadUInt64Array(tag, field_name, result.repeatedUint64_);
              break;
            }
            case 282:
            case 280: {
              input.ReadSInt32Array(tag, field_name, result.repeatedSint32_);
              break;
            }
            case 290:
            case 288: {
              input.ReadSInt64Array(tag, field_name, result.repeatedSint64_);
              break;
            }
            case 298:
            case 301: {
              input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_);
              break;
            }
            case 306:
            case 305: {
              input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_);
              break;
            }
            case 314:
            case 317: {
              input.ReadSFixed32Array(tag, field_name, result.repeatedSfixed32_);
              break;
            }
            case 322:
            case 321: {
              input.ReadSFixed64Array(tag, field_name, result.repeatedSfixed64_);
              break;
            }
            case 330:
            case 333: {
              input.ReadFloatArray(tag, field_name, result.repeatedFloat_);
              break;
            }
            case 338:
            case 337: {
              input.ReadDoubleArray(tag, field_name, result.repeatedDouble_);
              break;
            }
            case 346:
            case 344: {
              input.ReadBoolArray(tag, field_name, result.repeatedBool_);
              break;
            }
            case 354: {
              input.ReadStringArray(tag, field_name, result.repeatedString_);
              break;
            }
            case 362: {
              input.ReadBytesArray(tag, field_name, result.repeatedBytes_);
              break;
            }
            case 386: {
              input.ReadMessageArray(tag, field_name, result.repeatedNestedMessage_, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance, extensionRegistry);
              break;
            }
            case 394: {
              input.ReadMessageArray(tag, field_name, result.repeatedForeignMessage_, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance, extensionRegistry);
              break;
            }
            case 402: {
              input.ReadMessageArray(tag, field_name, result.repeatedProto2Message_, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance, extensionRegistry);
              break;
            }
            case 410:
            case 408: {
              scg::ICollection<object> unknownItems;
              input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum>(tag, field_name, result.repeatedNestedEnum_, out unknownItems);
              if (unknownItems != null) {
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                foreach (object rawValue in unknownItems)
                  if (rawValue is int)
                    unknownFields.MergeVarintField(51, (ulong)(int)rawValue);
              }
              break;
            }
            case 418:
            case 416: {
              scg::ICollection<object> unknownItems;
              input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum>(tag, field_name, result.repeatedForeignEnum_, out unknownItems);
              if (unknownItems != null) {
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                foreach (object rawValue in unknownItems)
                  if (rawValue is int)
                    unknownFields.MergeVarintField(52, (ulong)(int)rawValue);
              }
              break;
            }
            case 434: {
              input.ReadStringArray(tag, field_name, result.repeatedStringPiece_);
              break;
            }
            case 442: {
              input.ReadStringArray(tag, field_name, result.repeatedCord_);
              break;
            }
            case 458: {
              input.ReadMessageArray(tag, field_name, result.repeatedLazyMessage_, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance, extensionRegistry);
              break;
            }
            case 888: {
              uint value = 0;
              if (input.ReadUInt32(ref value)) {
                result.oneofField_ = value;
                result.oneofFieldCase_ = OneofFieldOneofCase.OneofUint32;
              }
              break;
            }
            case 898: {
              global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder();
              if (result.oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) {
                subBuilder.MergeFrom(OneofNestedMessage);
              }
              input.ReadMessage(subBuilder, extensionRegistry);
              result.oneofField_ = subBuilder.BuildPartial();
              result.oneofFieldCase_ = OneofFieldOneofCase.OneofNestedMessage;
              break;
            }
            case 906: {
              string value = "";
              if (input.ReadString(ref value)) {
                result.oneofField_ = value;
                result.oneofFieldCase_ = OneofFieldOneofCase.OneofString;
              }
              break;
            }
            case 912: {
              object unknown;
              global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum enumValue = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO;
              if(input.ReadEnum(ref enumValue, out unknown)) {
                result.oneofField_ = enumValue;
                result.oneofFieldCase_ = OneofFieldOneofCase.OneofEnum;
              } else if(unknown is int) {
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                unknownFields.MergeVarintField(114, (ulong)(int)unknown);
              }
              break;
            }
          }
        }

        if (unknownFields != null) {
          this.UnknownFields = unknownFields.Build();
        }
        return this;
      }


      public int OptionalInt32 {
        get { return result.OptionalInt32; }
        set { SetOptionalInt32(value); }
      }
      public Builder SetOptionalInt32(int value) {
        PrepareBuilder();
        result.optionalInt32_ = value;
        return this;
      }
      public Builder ClearOptionalInt32() {
        PrepareBuilder();
        result.optionalInt32_ = 0;
        return this;
      }

      public long OptionalInt64 {
        get { return result.OptionalInt64; }
        set { SetOptionalInt64(value); }
      }
      public Builder SetOptionalInt64(long value) {
        PrepareBuilder();
        result.optionalInt64_ = value;
        return this;
      }
      public Builder ClearOptionalInt64() {
        PrepareBuilder();
        result.optionalInt64_ = 0L;
        return this;
      }

      public uint OptionalUint32 {
        get { return result.OptionalUint32; }
        set { SetOptionalUint32(value); }
      }
      public Builder SetOptionalUint32(uint value) {
        PrepareBuilder();
        result.optionalUint32_ = value;
        return this;
      }
      public Builder ClearOptionalUint32() {
        PrepareBuilder();
        result.optionalUint32_ = 0;
        return this;
      }

      public ulong OptionalUint64 {
        get { return result.OptionalUint64; }
        set { SetOptionalUint64(value); }
      }
      public Builder SetOptionalUint64(ulong value) {
        PrepareBuilder();
        result.optionalUint64_ = value;
        return this;
      }
      public Builder ClearOptionalUint64() {
        PrepareBuilder();
        result.optionalUint64_ = 0UL;
        return this;
      }

      public int OptionalSint32 {
        get { return result.OptionalSint32; }
        set { SetOptionalSint32(value); }
      }
      public Builder SetOptionalSint32(int value) {
        PrepareBuilder();
        result.optionalSint32_ = value;
        return this;
      }
      public Builder ClearOptionalSint32() {
        PrepareBuilder();
        result.optionalSint32_ = 0;
        return this;
      }

      public long OptionalSint64 {
        get { return result.OptionalSint64; }
        set { SetOptionalSint64(value); }
      }
      public Builder SetOptionalSint64(long value) {
        PrepareBuilder();
        result.optionalSint64_ = value;
        return this;
      }
      public Builder ClearOptionalSint64() {
        PrepareBuilder();
        result.optionalSint64_ = 0L;
        return this;
      }

      public uint OptionalFixed32 {
        get { return result.OptionalFixed32; }
        set { SetOptionalFixed32(value); }
      }
      public Builder SetOptionalFixed32(uint value) {
        PrepareBuilder();
        result.optionalFixed32_ = value;
        return this;
      }
      public Builder ClearOptionalFixed32() {
        PrepareBuilder();
        result.optionalFixed32_ = 0;
        return this;
      }

      public ulong OptionalFixed64 {
        get { return result.OptionalFixed64; }
        set { SetOptionalFixed64(value); }
      }
      public Builder SetOptionalFixed64(ulong value) {
        PrepareBuilder();
        result.optionalFixed64_ = value;
        return this;
      }
      public Builder ClearOptionalFixed64() {
        PrepareBuilder();
        result.optionalFixed64_ = 0UL;
        return this;
      }

      public int OptionalSfixed32 {
        get { return result.OptionalSfixed32; }
        set { SetOptionalSfixed32(value); }
      }
      public Builder SetOptionalSfixed32(int value) {
        PrepareBuilder();
        result.optionalSfixed32_ = value;
        return this;
      }
      public Builder ClearOptionalSfixed32() {
        PrepareBuilder();
        result.optionalSfixed32_ = 0;
        return this;
      }

      public long OptionalSfixed64 {
        get { return result.OptionalSfixed64; }
        set { SetOptionalSfixed64(value); }
      }
      public Builder SetOptionalSfixed64(long value) {
        PrepareBuilder();
        result.optionalSfixed64_ = value;
        return this;
      }
      public Builder ClearOptionalSfixed64() {
        PrepareBuilder();
        result.optionalSfixed64_ = 0L;
        return this;
      }

      public float OptionalFloat {
        get { return result.OptionalFloat; }
        set { SetOptionalFloat(value); }
      }
      public Builder SetOptionalFloat(float value) {
        PrepareBuilder();
        result.optionalFloat_ = value;
        return this;
      }
      public Builder ClearOptionalFloat() {
        PrepareBuilder();
        result.optionalFloat_ = 0F;
        return this;
      }

      public double OptionalDouble {
        get { return result.OptionalDouble; }
        set { SetOptionalDouble(value); }
      }
      public Builder SetOptionalDouble(double value) {
        PrepareBuilder();
        result.optionalDouble_ = value;
        return this;
      }
      public Builder ClearOptionalDouble() {
        PrepareBuilder();
        result.optionalDouble_ = 0D;
        return this;
      }

      public bool OptionalBool {
        get { return result.OptionalBool; }
        set { SetOptionalBool(value); }
      }
      public Builder SetOptionalBool(bool value) {
        PrepareBuilder();
        result.optionalBool_ = value;
        return this;
      }
      public Builder ClearOptionalBool() {
        PrepareBuilder();
        result.optionalBool_ = false;
        return this;
      }

      public string OptionalString {
        get { return result.OptionalString; }
        set { SetOptionalString(value); }
      }
      public Builder SetOptionalString(string value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.optionalString_ = value;
        return this;
      }
      public Builder ClearOptionalString() {
        PrepareBuilder();
        result.optionalString_ = "";
        return this;
      }

      public pb::ByteString OptionalBytes {
        get { return result.OptionalBytes; }
        set { SetOptionalBytes(value); }
      }
      public Builder SetOptionalBytes(pb::ByteString value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.optionalBytes_ = value;
        return this;
      }
      public Builder ClearOptionalBytes() {
        PrepareBuilder();
        result.optionalBytes_ = pb::ByteString.Empty;
        return this;
      }

      public bool HasOptionalNestedMessage {
       get { return result.hasOptionalNestedMessage; }
      }
      public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OptionalNestedMessage {
        get { return result.OptionalNestedMessage; }
        set { SetOptionalNestedMessage(value); }
      }
      public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.hasOptionalNestedMessage = true;
        result.optionalNestedMessage_ = value;
        return this;
      }
      public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        PrepareBuilder();
        result.hasOptionalNestedMessage = true;
        result.optionalNestedMessage_ = builderForValue.Build();
        return this;
      }
      public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        if (result.hasOptionalNestedMessage &&
            result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance) {
            result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial();
        } else {
          result.optionalNestedMessage_ = value;
        }
        result.hasOptionalNestedMessage = true;
        return this;
      }
      public Builder ClearOptionalNestedMessage() {
        PrepareBuilder();
        result.hasOptionalNestedMessage = false;
        result.optionalNestedMessage_ = null;
        return this;
      }

      public bool HasOptionalForeignMessage {
       get { return result.hasOptionalForeignMessage; }
      }
      public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage OptionalForeignMessage {
        get { return result.OptionalForeignMessage; }
        set { SetOptionalForeignMessage(value); }
      }
      public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.hasOptionalForeignMessage = true;
        result.optionalForeignMessage_ = value;
        return this;
      }
      public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        PrepareBuilder();
        result.hasOptionalForeignMessage = true;
        result.optionalForeignMessage_ = builderForValue.Build();
        return this;
      }
      public Builder MergeOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        if (result.hasOptionalForeignMessage &&
            result.optionalForeignMessage_ != global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance) {
            result.optionalForeignMessage_ = global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.CreateBuilder(result.optionalForeignMessage_).MergeFrom(value).BuildPartial();
        } else {
          result.optionalForeignMessage_ = value;
        }
        result.hasOptionalForeignMessage = true;
        return this;
      }
      public Builder ClearOptionalForeignMessage() {
        PrepareBuilder();
        result.hasOptionalForeignMessage = false;
        result.optionalForeignMessage_ = null;
        return this;
      }

      public bool HasOptionalProto2Message {
       get { return result.hasOptionalProto2Message; }
      }
      public global::Google.ProtocolBuffers.TestProtos.TestAllTypes OptionalProto2Message {
        get { return result.OptionalProto2Message; }
        set { SetOptionalProto2Message(value); }
      }
      public Builder SetOptionalProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.hasOptionalProto2Message = true;
        result.optionalProto2Message_ = value;
        return this;
      }
      public Builder SetOptionalProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        PrepareBuilder();
        result.hasOptionalProto2Message = true;
        result.optionalProto2Message_ = builderForValue.Build();
        return this;
      }
      public Builder MergeOptionalProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        if (result.hasOptionalProto2Message &&
            result.optionalProto2Message_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance) {
            result.optionalProto2Message_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder(result.optionalProto2Message_).MergeFrom(value).BuildPartial();
        } else {
          result.optionalProto2Message_ = value;
        }
        result.hasOptionalProto2Message = true;
        return this;
      }
      public Builder ClearOptionalProto2Message() {
        PrepareBuilder();
        result.hasOptionalProto2Message = false;
        result.optionalProto2Message_ = null;
        return this;
      }

      public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum OptionalNestedEnum {
        get { return result.OptionalNestedEnum; }
        set { SetOptionalNestedEnum(value); }
      }
      public Builder SetOptionalNestedEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum value) {
        PrepareBuilder();
        result.optionalNestedEnum_ = value;
        return this;
      }
      public Builder ClearOptionalNestedEnum() {
        PrepareBuilder();
        result.optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO;
        return this;
      }

      public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum OptionalForeignEnum {
        get { return result.OptionalForeignEnum; }
        set { SetOptionalForeignEnum(value); }
      }
      public Builder SetOptionalForeignEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum value) {
        PrepareBuilder();
        result.optionalForeignEnum_ = value;
        return this;
      }
      public Builder ClearOptionalForeignEnum() {
        PrepareBuilder();
        result.optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum.FOREIGN_FOO;
        return this;
      }

      public string OptionalStringPiece {
        get { return result.OptionalStringPiece; }
        set { SetOptionalStringPiece(value); }
      }
      public Builder SetOptionalStringPiece(string value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.optionalStringPiece_ = value;
        return this;
      }
      public Builder ClearOptionalStringPiece() {
        PrepareBuilder();
        result.optionalStringPiece_ = "";
        return this;
      }

      public string OptionalCord {
        get { return result.OptionalCord; }
        set { SetOptionalCord(value); }
      }
      public Builder SetOptionalCord(string value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.optionalCord_ = value;
        return this;
      }
      public Builder ClearOptionalCord() {
        PrepareBuilder();
        result.optionalCord_ = "";
        return this;
      }

      public bool HasOptionalLazyMessage {
       get { return result.hasOptionalLazyMessage; }
      }
      public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OptionalLazyMessage {
        get { return result.OptionalLazyMessage; }
        set { SetOptionalLazyMessage(value); }
      }
      public Builder SetOptionalLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.hasOptionalLazyMessage = true;
        result.optionalLazyMessage_ = value;
        return this;
      }
      public Builder SetOptionalLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        PrepareBuilder();
        result.hasOptionalLazyMessage = true;
        result.optionalLazyMessage_ = builderForValue.Build();
        return this;
      }
      public Builder MergeOptionalLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        if (result.hasOptionalLazyMessage &&
            result.optionalLazyMessage_ != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance) {
            result.optionalLazyMessage_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalLazyMessage_).MergeFrom(value).BuildPartial();
        } else {
          result.optionalLazyMessage_ = value;
        }
        result.hasOptionalLazyMessage = true;
        return this;
      }
      public Builder ClearOptionalLazyMessage() {
        PrepareBuilder();
        result.hasOptionalLazyMessage = false;
        result.optionalLazyMessage_ = null;
        return this;
      }

      public pbc::IPopsicleList<int> RepeatedInt32List {
        get { return PrepareBuilder().repeatedInt32_; }
      }
      public int RepeatedInt32Count {
        get { return result.RepeatedInt32Count; }
      }
      public int GetRepeatedInt32(int index) {
        return result.GetRepeatedInt32(index);
      }
      public Builder SetRepeatedInt32(int index, int value) {
        PrepareBuilder();
        result.repeatedInt32_[index] = value;
        return this;
      }
      public Builder AddRepeatedInt32(int value) {
        PrepareBuilder();
        result.repeatedInt32_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedInt32(scg::IEnumerable<int> values) {
        PrepareBuilder();
        result.repeatedInt32_.Add(values);
        return this;
      }
      public Builder ClearRepeatedInt32() {
        PrepareBuilder();
        result.repeatedInt32_.Clear();
        return this;
      }

      public pbc::IPopsicleList<long> RepeatedInt64List {
        get { return PrepareBuilder().repeatedInt64_; }
      }
      public int RepeatedInt64Count {
        get { return result.RepeatedInt64Count; }
      }
      public long GetRepeatedInt64(int index) {
        return result.GetRepeatedInt64(index);
      }
      public Builder SetRepeatedInt64(int index, long value) {
        PrepareBuilder();
        result.repeatedInt64_[index] = value;
        return this;
      }
      public Builder AddRepeatedInt64(long value) {
        PrepareBuilder();
        result.repeatedInt64_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedInt64(scg::IEnumerable<long> values) {
        PrepareBuilder();
        result.repeatedInt64_.Add(values);
        return this;
      }
      public Builder ClearRepeatedInt64() {
        PrepareBuilder();
        result.repeatedInt64_.Clear();
        return this;
      }

      public pbc::IPopsicleList<uint> RepeatedUint32List {
        get { return PrepareBuilder().repeatedUint32_; }
      }
      public int RepeatedUint32Count {
        get { return result.RepeatedUint32Count; }
      }
      public uint GetRepeatedUint32(int index) {
        return result.GetRepeatedUint32(index);
      }
      public Builder SetRepeatedUint32(int index, uint value) {
        PrepareBuilder();
        result.repeatedUint32_[index] = value;
        return this;
      }
      public Builder AddRepeatedUint32(uint value) {
        PrepareBuilder();
        result.repeatedUint32_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedUint32(scg::IEnumerable<uint> values) {
        PrepareBuilder();
        result.repeatedUint32_.Add(values);
        return this;
      }
      public Builder ClearRepeatedUint32() {
        PrepareBuilder();
        result.repeatedUint32_.Clear();
        return this;
      }

      public pbc::IPopsicleList<ulong> RepeatedUint64List {
        get { return PrepareBuilder().repeatedUint64_; }
      }
      public int RepeatedUint64Count {
        get { return result.RepeatedUint64Count; }
      }
      public ulong GetRepeatedUint64(int index) {
        return result.GetRepeatedUint64(index);
      }
      public Builder SetRepeatedUint64(int index, ulong value) {
        PrepareBuilder();
        result.repeatedUint64_[index] = value;
        return this;
      }
      public Builder AddRepeatedUint64(ulong value) {
        PrepareBuilder();
        result.repeatedUint64_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedUint64(scg::IEnumerable<ulong> values) {
        PrepareBuilder();
        result.repeatedUint64_.Add(values);
        return this;
      }
      public Builder ClearRepeatedUint64() {
        PrepareBuilder();
        result.repeatedUint64_.Clear();
        return this;
      }

      public pbc::IPopsicleList<int> RepeatedSint32List {
        get { return PrepareBuilder().repeatedSint32_; }
      }
      public int RepeatedSint32Count {
        get { return result.RepeatedSint32Count; }
      }
      public int GetRepeatedSint32(int index) {
        return result.GetRepeatedSint32(index);
      }
      public Builder SetRepeatedSint32(int index, int value) {
        PrepareBuilder();
        result.repeatedSint32_[index] = value;
        return this;
      }
      public Builder AddRepeatedSint32(int value) {
        PrepareBuilder();
        result.repeatedSint32_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedSint32(scg::IEnumerable<int> values) {
        PrepareBuilder();
        result.repeatedSint32_.Add(values);
        return this;
      }
      public Builder ClearRepeatedSint32() {
        PrepareBuilder();
        result.repeatedSint32_.Clear();
        return this;
      }

      public pbc::IPopsicleList<long> RepeatedSint64List {
        get { return PrepareBuilder().repeatedSint64_; }
      }
      public int RepeatedSint64Count {
        get { return result.RepeatedSint64Count; }
      }
      public long GetRepeatedSint64(int index) {
        return result.GetRepeatedSint64(index);
      }
      public Builder SetRepeatedSint64(int index, long value) {
        PrepareBuilder();
        result.repeatedSint64_[index] = value;
        return this;
      }
      public Builder AddRepeatedSint64(long value) {
        PrepareBuilder();
        result.repeatedSint64_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedSint64(scg::IEnumerable<long> values) {
        PrepareBuilder();
        result.repeatedSint64_.Add(values);
        return this;
      }
      public Builder ClearRepeatedSint64() {
        PrepareBuilder();
        result.repeatedSint64_.Clear();
        return this;
      }

      public pbc::IPopsicleList<uint> RepeatedFixed32List {
        get { return PrepareBuilder().repeatedFixed32_; }
      }
      public int RepeatedFixed32Count {
        get { return result.RepeatedFixed32Count; }
      }
      public uint GetRepeatedFixed32(int index) {
        return result.GetRepeatedFixed32(index);
      }
      public Builder SetRepeatedFixed32(int index, uint value) {
        PrepareBuilder();
        result.repeatedFixed32_[index] = value;
        return this;
      }
      public Builder AddRepeatedFixed32(uint value) {
        PrepareBuilder();
        result.repeatedFixed32_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedFixed32(scg::IEnumerable<uint> values) {
        PrepareBuilder();
        result.repeatedFixed32_.Add(values);
        return this;
      }
      public Builder ClearRepeatedFixed32() {
        PrepareBuilder();
        result.repeatedFixed32_.Clear();
        return this;
      }

      public pbc::IPopsicleList<ulong> RepeatedFixed64List {
        get { return PrepareBuilder().repeatedFixed64_; }
      }
      public int RepeatedFixed64Count {
        get { return result.RepeatedFixed64Count; }
      }
      public ulong GetRepeatedFixed64(int index) {
        return result.GetRepeatedFixed64(index);
      }
      public Builder SetRepeatedFixed64(int index, ulong value) {
        PrepareBuilder();
        result.repeatedFixed64_[index] = value;
        return this;
      }
      public Builder AddRepeatedFixed64(ulong value) {
        PrepareBuilder();
        result.repeatedFixed64_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedFixed64(scg::IEnumerable<ulong> values) {
        PrepareBuilder();
        result.repeatedFixed64_.Add(values);
        return this;
      }
      public Builder ClearRepeatedFixed64() {
        PrepareBuilder();
        result.repeatedFixed64_.Clear();
        return this;
      }

      public pbc::IPopsicleList<int> RepeatedSfixed32List {
        get { return PrepareBuilder().repeatedSfixed32_; }
      }
      public int RepeatedSfixed32Count {
        get { return result.RepeatedSfixed32Count; }
      }
      public int GetRepeatedSfixed32(int index) {
        return result.GetRepeatedSfixed32(index);
      }
      public Builder SetRepeatedSfixed32(int index, int value) {
        PrepareBuilder();
        result.repeatedSfixed32_[index] = value;
        return this;
      }
      public Builder AddRepeatedSfixed32(int value) {
        PrepareBuilder();
        result.repeatedSfixed32_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedSfixed32(scg::IEnumerable<int> values) {
        PrepareBuilder();
        result.repeatedSfixed32_.Add(values);
        return this;
      }
      public Builder ClearRepeatedSfixed32() {
        PrepareBuilder();
        result.repeatedSfixed32_.Clear();
        return this;
      }

      public pbc::IPopsicleList<long> RepeatedSfixed64List {
        get { return PrepareBuilder().repeatedSfixed64_; }
      }
      public int RepeatedSfixed64Count {
        get { return result.RepeatedSfixed64Count; }
      }
      public long GetRepeatedSfixed64(int index) {
        return result.GetRepeatedSfixed64(index);
      }
      public Builder SetRepeatedSfixed64(int index, long value) {
        PrepareBuilder();
        result.repeatedSfixed64_[index] = value;
        return this;
      }
      public Builder AddRepeatedSfixed64(long value) {
        PrepareBuilder();
        result.repeatedSfixed64_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedSfixed64(scg::IEnumerable<long> values) {
        PrepareBuilder();
        result.repeatedSfixed64_.Add(values);
        return this;
      }
      public Builder ClearRepeatedSfixed64() {
        PrepareBuilder();
        result.repeatedSfixed64_.Clear();
        return this;
      }

      public pbc::IPopsicleList<float> RepeatedFloatList {
        get { return PrepareBuilder().repeatedFloat_; }
      }
      public int RepeatedFloatCount {
        get { return result.RepeatedFloatCount; }
      }
      public float GetRepeatedFloat(int index) {
        return result.GetRepeatedFloat(index);
      }
      public Builder SetRepeatedFloat(int index, float value) {
        PrepareBuilder();
        result.repeatedFloat_[index] = value;
        return this;
      }
      public Builder AddRepeatedFloat(float value) {
        PrepareBuilder();
        result.repeatedFloat_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedFloat(scg::IEnumerable<float> values) {
        PrepareBuilder();
        result.repeatedFloat_.Add(values);
        return this;
      }
      public Builder ClearRepeatedFloat() {
        PrepareBuilder();
        result.repeatedFloat_.Clear();
        return this;
      }

      public pbc::IPopsicleList<double> RepeatedDoubleList {
        get { return PrepareBuilder().repeatedDouble_; }
      }
      public int RepeatedDoubleCount {
        get { return result.RepeatedDoubleCount; }
      }
      public double GetRepeatedDouble(int index) {
        return result.GetRepeatedDouble(index);
      }
      public Builder SetRepeatedDouble(int index, double value) {
        PrepareBuilder();
        result.repeatedDouble_[index] = value;
        return this;
      }
      public Builder AddRepeatedDouble(double value) {
        PrepareBuilder();
        result.repeatedDouble_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedDouble(scg::IEnumerable<double> values) {
        PrepareBuilder();
        result.repeatedDouble_.Add(values);
        return this;
      }
      public Builder ClearRepeatedDouble() {
        PrepareBuilder();
        result.repeatedDouble_.Clear();
        return this;
      }

      public pbc::IPopsicleList<bool> RepeatedBoolList {
        get { return PrepareBuilder().repeatedBool_; }
      }
      public int RepeatedBoolCount {
        get { return result.RepeatedBoolCount; }
      }
      public bool GetRepeatedBool(int index) {
        return result.GetRepeatedBool(index);
      }
      public Builder SetRepeatedBool(int index, bool value) {
        PrepareBuilder();
        result.repeatedBool_[index] = value;
        return this;
      }
      public Builder AddRepeatedBool(bool value) {
        PrepareBuilder();
        result.repeatedBool_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedBool(scg::IEnumerable<bool> values) {
        PrepareBuilder();
        result.repeatedBool_.Add(values);
        return this;
      }
      public Builder ClearRepeatedBool() {
        PrepareBuilder();
        result.repeatedBool_.Clear();
        return this;
      }

      public pbc::IPopsicleList<string> RepeatedStringList {
        get { return PrepareBuilder().repeatedString_; }
      }
      public int RepeatedStringCount {
        get { return result.RepeatedStringCount; }
      }
      public string GetRepeatedString(int index) {
        return result.GetRepeatedString(index);
      }
      public Builder SetRepeatedString(int index, string value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedString_[index] = value;
        return this;
      }
      public Builder AddRepeatedString(string value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedString_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedString(scg::IEnumerable<string> values) {
        PrepareBuilder();
        result.repeatedString_.Add(values);
        return this;
      }
      public Builder ClearRepeatedString() {
        PrepareBuilder();
        result.repeatedString_.Clear();
        return this;
      }

      public pbc::IPopsicleList<pb::ByteString> RepeatedBytesList {
        get { return PrepareBuilder().repeatedBytes_; }
      }
      public int RepeatedBytesCount {
        get { return result.RepeatedBytesCount; }
      }
      public pb::ByteString GetRepeatedBytes(int index) {
        return result.GetRepeatedBytes(index);
      }
      public Builder SetRepeatedBytes(int index, pb::ByteString value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedBytes_[index] = value;
        return this;
      }
      public Builder AddRepeatedBytes(pb::ByteString value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedBytes_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedBytes(scg::IEnumerable<pb::ByteString> values) {
        PrepareBuilder();
        result.repeatedBytes_.Add(values);
        return this;
      }
      public Builder ClearRepeatedBytes() {
        PrepareBuilder();
        result.repeatedBytes_.Clear();
        return this;
      }

      public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> RepeatedNestedMessageList {
        get { return PrepareBuilder().repeatedNestedMessage_; }
      }
      public int RepeatedNestedMessageCount {
        get { return result.RepeatedNestedMessageCount; }
      }
      public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) {
        return result.GetRepeatedNestedMessage(index);
      }
      public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedNestedMessage_[index] = value;
        return this;
      }
      public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        PrepareBuilder();
        result.repeatedNestedMessage_[index] = builderForValue.Build();
        return this;
      }
      public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedNestedMessage_.Add(value);
        return this;
      }
      public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        PrepareBuilder();
        result.repeatedNestedMessage_.Add(builderForValue.Build());
        return this;
      }
      public Builder AddRangeRepeatedNestedMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> values) {
        PrepareBuilder();
        result.repeatedNestedMessage_.Add(values);
        return this;
      }
      public Builder ClearRepeatedNestedMessage() {
        PrepareBuilder();
        result.repeatedNestedMessage_.Clear();
        return this;
      }

      public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage> RepeatedForeignMessageList {
        get { return PrepareBuilder().repeatedForeignMessage_; }
      }
      public int RepeatedForeignMessageCount {
        get { return result.RepeatedForeignMessageCount; }
      }
      public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage GetRepeatedForeignMessage(int index) {
        return result.GetRepeatedForeignMessage(index);
      }
      public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedForeignMessage_[index] = value;
        return this;
      }
      public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        PrepareBuilder();
        result.repeatedForeignMessage_[index] = builderForValue.Build();
        return this;
      }
      public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedForeignMessage_.Add(value);
        return this;
      }
      public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        PrepareBuilder();
        result.repeatedForeignMessage_.Add(builderForValue.Build());
        return this;
      }
      public Builder AddRangeRepeatedForeignMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage> values) {
        PrepareBuilder();
        result.repeatedForeignMessage_.Add(values);
        return this;
      }
      public Builder ClearRepeatedForeignMessage() {
        PrepareBuilder();
        result.repeatedForeignMessage_.Clear();
        return this;
      }

      public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> RepeatedProto2MessageList {
        get { return PrepareBuilder().repeatedProto2Message_; }
      }
      public int RepeatedProto2MessageCount {
        get { return result.RepeatedProto2MessageCount; }
      }
      public global::Google.ProtocolBuffers.TestProtos.TestAllTypes GetRepeatedProto2Message(int index) {
        return result.GetRepeatedProto2Message(index);
      }
      public Builder SetRepeatedProto2Message(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedProto2Message_[index] = value;
        return this;
      }
      public Builder SetRepeatedProto2Message(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        PrepareBuilder();
        result.repeatedProto2Message_[index] = builderForValue.Build();
        return this;
      }
      public Builder AddRepeatedProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedProto2Message_.Add(value);
        return this;
      }
      public Builder AddRepeatedProto2Message(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        PrepareBuilder();
        result.repeatedProto2Message_.Add(builderForValue.Build());
        return this;
      }
      public Builder AddRangeRepeatedProto2Message(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> values) {
        PrepareBuilder();
        result.repeatedProto2Message_.Add(values);
        return this;
      }
      public Builder ClearRepeatedProto2Message() {
        PrepareBuilder();
        result.repeatedProto2Message_.Clear();
        return this;
      }

      public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum> RepeatedNestedEnumList {
        get { return PrepareBuilder().repeatedNestedEnum_; }
      }
      public int RepeatedNestedEnumCount {
        get { return result.RepeatedNestedEnumCount; }
      }
      public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) {
        return result.GetRepeatedNestedEnum(index);
      }
      public Builder SetRepeatedNestedEnum(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum value) {
        PrepareBuilder();
        result.repeatedNestedEnum_[index] = value;
        return this;
      }
      public Builder AddRepeatedNestedEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum value) {
        PrepareBuilder();
        result.repeatedNestedEnum_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedNestedEnum(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum> values) {
        PrepareBuilder();
        result.repeatedNestedEnum_.Add(values);
        return this;
      }
      public Builder ClearRepeatedNestedEnum() {
        PrepareBuilder();
        result.repeatedNestedEnum_.Clear();
        return this;
      }

      public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum> RepeatedForeignEnumList {
        get { return PrepareBuilder().repeatedForeignEnum_; }
      }
      public int RepeatedForeignEnumCount {
        get { return result.RepeatedForeignEnumCount; }
      }
      public global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum GetRepeatedForeignEnum(int index) {
        return result.GetRepeatedForeignEnum(index);
      }
      public Builder SetRepeatedForeignEnum(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum value) {
        PrepareBuilder();
        result.repeatedForeignEnum_[index] = value;
        return this;
      }
      public Builder AddRepeatedForeignEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum value) {
        PrepareBuilder();
        result.repeatedForeignEnum_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedForeignEnum(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignEnum> values) {
        PrepareBuilder();
        result.repeatedForeignEnum_.Add(values);
        return this;
      }
      public Builder ClearRepeatedForeignEnum() {
        PrepareBuilder();
        result.repeatedForeignEnum_.Clear();
        return this;
      }

      public pbc::IPopsicleList<string> RepeatedStringPieceList {
        get { return PrepareBuilder().repeatedStringPiece_; }
      }
      public int RepeatedStringPieceCount {
        get { return result.RepeatedStringPieceCount; }
      }
      public string GetRepeatedStringPiece(int index) {
        return result.GetRepeatedStringPiece(index);
      }
      public Builder SetRepeatedStringPiece(int index, string value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedStringPiece_[index] = value;
        return this;
      }
      public Builder AddRepeatedStringPiece(string value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedStringPiece_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedStringPiece(scg::IEnumerable<string> values) {
        PrepareBuilder();
        result.repeatedStringPiece_.Add(values);
        return this;
      }
      public Builder ClearRepeatedStringPiece() {
        PrepareBuilder();
        result.repeatedStringPiece_.Clear();
        return this;
      }

      public pbc::IPopsicleList<string> RepeatedCordList {
        get { return PrepareBuilder().repeatedCord_; }
      }
      public int RepeatedCordCount {
        get { return result.RepeatedCordCount; }
      }
      public string GetRepeatedCord(int index) {
        return result.GetRepeatedCord(index);
      }
      public Builder SetRepeatedCord(int index, string value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedCord_[index] = value;
        return this;
      }
      public Builder AddRepeatedCord(string value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedCord_.Add(value);
        return this;
      }
      public Builder AddRangeRepeatedCord(scg::IEnumerable<string> values) {
        PrepareBuilder();
        result.repeatedCord_.Add(values);
        return this;
      }
      public Builder ClearRepeatedCord() {
        PrepareBuilder();
        result.repeatedCord_.Clear();
        return this;
      }

      public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> RepeatedLazyMessageList {
        get { return PrepareBuilder().repeatedLazyMessage_; }
      }
      public int RepeatedLazyMessageCount {
        get { return result.RepeatedLazyMessageCount; }
      }
      public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage GetRepeatedLazyMessage(int index) {
        return result.GetRepeatedLazyMessage(index);
      }
      public Builder SetRepeatedLazyMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedLazyMessage_[index] = value;
        return this;
      }
      public Builder SetRepeatedLazyMessage(int index, global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        PrepareBuilder();
        result.repeatedLazyMessage_[index] = builderForValue.Build();
        return this;
      }
      public Builder AddRepeatedLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.repeatedLazyMessage_.Add(value);
        return this;
      }
      public Builder AddRepeatedLazyMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        PrepareBuilder();
        result.repeatedLazyMessage_.Add(builderForValue.Build());
        return this;
      }
      public Builder AddRangeRepeatedLazyMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage> values) {
        PrepareBuilder();
        result.repeatedLazyMessage_.Add(values);
        return this;
      }
      public Builder ClearRepeatedLazyMessage() {
        PrepareBuilder();
        result.repeatedLazyMessage_.Clear();
        return this;
      }

      public uint OneofUint32 {
        get { return result.oneofFieldCase_ == OneofFieldOneofCase.OneofUint32 ? (uint) result.oneofField_ : 0; }
        set { SetOneofUint32(value); }
      }
      public Builder SetOneofUint32(uint value) {
        PrepareBuilder();
        result.oneofField_ = value;
        result.oneofFieldCase_ = OneofFieldOneofCase.OneofUint32;
        return this;
      }
      public Builder ClearOneofUint32() {
        PrepareBuilder();
        if (result.oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) {
          result.oneofFieldCase_ = OneofFieldOneofCase.None;
        }
        return this;
      }

      public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage OneofNestedMessage {
        get { return result.oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage) result.oneofField_ : global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance; }
        set { SetOneofNestedMessage(value); }
      }
      public Builder SetOneofNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.oneofFieldCase_ = OneofFieldOneofCase.OneofNestedMessage;
        result.oneofField_ = value;
        return this;
      }
      public Builder SetOneofNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        PrepareBuilder();
        result.oneofFieldCase_ = OneofFieldOneofCase.OneofNestedMessage;
        result.oneofField_ = builderForValue.Build();
        return this;
      }
      public Builder MergeOneofNestedMessage(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        if (result.oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage &&
            result.OneofNestedMessage != global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.DefaultInstance) {
          result.oneofField_ = global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedMessage.CreateBuilder(result.OneofNestedMessage).MergeFrom(value).BuildPartial();
        } else {
          result.oneofField_ = value;
        }
        result.oneofFieldCase_ = OneofFieldOneofCase.OneofNestedMessage;
        return this;
      }
      public Builder ClearOneofNestedMessage() {
        if (result.oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) {
          PrepareBuilder();
          result.oneofFieldCase_ = OneofFieldOneofCase.None;
          result.oneofField_ = null;
        }
        return this;
      }

      public string OneofString {
        get { return result.oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) result.oneofField_ : ""; }
        set { SetOneofString(value); }
      }
      public Builder SetOneofString(string value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.oneofField_ = value;
        result.oneofFieldCase_ = OneofFieldOneofCase.OneofString;
        return this;
      }
      public Builder ClearOneofString() {
        PrepareBuilder();
        if (result.oneofFieldCase_ == OneofFieldOneofCase.OneofString) {
          result.oneofFieldCase_ = OneofFieldOneofCase.None;
        }
        return this;
      }

      public global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum OneofEnum {
        get { return result.oneofFieldCase_ == OneofFieldOneofCase.OneofEnum ? (global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum) result.oneofField_ : global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum.FOO; }
        set { SetOneofEnum(value); }
      }
      public Builder SetOneofEnum(global::Google.ProtocolBuffers.TestProtos.Proto3.TestAllTypes.Types.NestedEnum value) {
        PrepareBuilder();
        result.oneofField_ = value;
        result.oneofFieldCase_ = OneofFieldOneofCase.OneofEnum;
        return this;
      }
      public Builder ClearOneofEnum() {
        PrepareBuilder();
        if (result.oneofFieldCase_ == OneofFieldOneofCase.OneofEnum) {
          result.oneofFieldCase_ = OneofFieldOneofCase.None;
        }
        return this;
      }

      public OneofFieldOneofCase OneofFieldCase {
        get { return result.oneofFieldCase_; }
      }
      public Builder ClearOneofField() {
        PrepareBuilder();
        result.oneofField_ = null;
        result.oneofFieldCase_ = OneofFieldOneofCase.None;
        return this;
      }
    }
    static TestAllTypes() {
      object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.Descriptor, null);
    }
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class TestProto2Required : pb::GeneratedMessage<TestProto2Required, TestProto2Required.Builder> {
    private TestProto2Required() { }
    private static readonly TestProto2Required defaultInstance = new TestProto2Required().MakeReadOnly();
    private static readonly string[] _testProto2RequiredFieldNames = new string[] { "proto2" };
    private static readonly uint[] _testProto2RequiredFieldTags = new uint[] { 10 };
    public static TestProto2Required DefaultInstance {
      get { return defaultInstance; }
    }

    public override TestProto2Required DefaultInstanceForType {
      get { return DefaultInstance; }
    }

    protected override TestProto2Required ThisMessage {
      get { return this; }
    }

    public static pbd::MessageDescriptor Descriptor {
      get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestProto2Required__Descriptor; }
    }

    protected override pb::FieldAccess.FieldAccessorTable<TestProto2Required, TestProto2Required.Builder> InternalFieldAccessors {
      get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_TestProto2Required__FieldAccessorTable; }
    }

    public const int Proto2FieldNumber = 1;
    private bool hasProto2;
    private global::Google.ProtocolBuffers.TestProtos.TestRequired proto2_;
    public bool HasProto2 {
      get { return hasProto2; }
    }
    public global::Google.ProtocolBuffers.TestProtos.TestRequired Proto2 {
      get { return proto2_ ?? global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance; }
    }

    public override void WriteTo(pb::ICodedOutputStream output) {
      CalcSerializedSize();
      string[] field_names = _testProto2RequiredFieldNames;
      if (hasProto2) {
        output.WriteMessage(1, field_names[0], Proto2);
      }
      UnknownFields.WriteTo(output);
    }

    private int memoizedSerializedSize = -1;
    public override int SerializedSize {
      get {
        int size = memoizedSerializedSize;
        if (size != -1) return size;
        return CalcSerializedSize();
      }
    }

    private int CalcSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (hasProto2) {
        size += pb::CodedOutputStream.ComputeMessageSize(1, Proto2);
      }
      size += UnknownFields.SerializedSize;
      memoizedSerializedSize = size;
      return size;
    }
    public static TestProto2Required ParseFrom(pb::ByteString data) {
      return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
    }
    public static TestProto2Required ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
    }
    public static TestProto2Required ParseFrom(byte[] data) {
      return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
    }
    public static TestProto2Required ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
    }
    public static TestProto2Required ParseFrom(global::System.IO.Stream input) {
      return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
    }
    public static TestProto2Required ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
    }
    public static TestProto2Required ParseDelimitedFrom(global::System.IO.Stream input) {
      return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
    }
    public static TestProto2Required ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
      return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
    }
    public static TestProto2Required ParseFrom(pb::ICodedInputStream input) {
      return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
    }
    public static TestProto2Required ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
    }
    private TestProto2Required MakeReadOnly() {
      return this;
    }

    public static Builder CreateBuilder() { return new Builder(); }
    public override Builder ToBuilder() { return CreateBuilder(this); }
    public override Builder CreateBuilderForType() { return new Builder(); }
    public static Builder CreateBuilder(TestProto2Required prototype) {
      return new Builder(prototype);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    public sealed partial class Builder : pb::GeneratedBuilder<TestProto2Required, Builder> {
      protected override Builder ThisBuilder {
        get { return this; }
      }
      public Builder() {
        result = DefaultInstance;
        resultIsReadOnly = true;
      }
      internal Builder(TestProto2Required cloneFrom) {
        result = cloneFrom;
        resultIsReadOnly = true;
      }

      private bool resultIsReadOnly;
      private TestProto2Required result;

      private TestProto2Required PrepareBuilder() {
        if (resultIsReadOnly) {
          TestProto2Required original = result;
          result = new TestProto2Required();
          resultIsReadOnly = false;
          MergeFrom(original);
        }
        return result;
      }

      public override bool IsInitialized {
        get { return result.IsInitialized; }
      }

      protected override TestProto2Required MessageBeingBuilt {
        get { return PrepareBuilder(); }
      }

      public override Builder Clear() {
        result = DefaultInstance;
        resultIsReadOnly = true;
        return this;
      }

      public override Builder Clone() {
        if (resultIsReadOnly) {
          return new Builder(result);
        } else {
          return new Builder().MergeFrom(result);
        }
      }

      public override pbd::MessageDescriptor DescriptorForType {
        get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required.Descriptor; }
      }

      public override TestProto2Required DefaultInstanceForType {
        get { return global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required.DefaultInstance; }
      }

      public override TestProto2Required BuildPartial() {
        if (resultIsReadOnly) {
          return result;
        }
        resultIsReadOnly = true;
        return result.MakeReadOnly();
      }

      public override Builder MergeFrom(pb::IMessage other) {
        if (other is TestProto2Required) {
          return MergeFrom((TestProto2Required) other);
        } else {
          base.MergeFrom(other);
          return this;
        }
      }

      public override Builder MergeFrom(TestProto2Required other) {
        if (other == global::Google.ProtocolBuffers.TestProtos.Proto3.TestProto2Required.DefaultInstance) return this;
        PrepareBuilder();
        if (other.HasProto2) {
          MergeProto2(other.Proto2);
        }
        this.MergeUnknownFields(other.UnknownFields);
        return this;
      }

      public override Builder MergeFrom(pb::ICodedInputStream input) {
        return MergeFrom(input, pb::ExtensionRegistry.Empty);
      }

      public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
        PrepareBuilder();
        pb::UnknownFieldSet.Builder unknownFields = null;
        uint tag;
        string field_name;
        while (input.ReadTag(out tag, out field_name)) {
          if(tag == 0 && field_name != null) {
            int field_ordinal = global::System.Array.BinarySearch(_testProto2RequiredFieldNames, field_name, global::System.StringComparer.Ordinal);
            if(field_ordinal >= 0)
              tag = _testProto2RequiredFieldTags[field_ordinal];
            else {
              if (unknownFields == null) {
                unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
              }
              ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
              continue;
            }
          }
          switch (tag) {
            case 0: {
              throw pb::InvalidProtocolBufferException.InvalidTag();
            }
            default: {
              if (pb::WireFormat.IsEndGroupTag(tag)) {
                if (unknownFields != null) {
                  this.UnknownFields = unknownFields.Build();
                }
                return this;
              }
              if (unknownFields == null) {
                unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
              }
              ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
              break;
            }
            case 10: {
              global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder();
              if (result.hasProto2) {
                subBuilder.MergeFrom(Proto2);
              }
              input.ReadMessage(subBuilder, extensionRegistry);
              Proto2 = subBuilder.BuildPartial();
              break;
            }
          }
        }

        if (unknownFields != null) {
          this.UnknownFields = unknownFields.Build();
        }
        return this;
      }


      public bool HasProto2 {
       get { return result.hasProto2; }
      }
      public global::Google.ProtocolBuffers.TestProtos.TestRequired Proto2 {
        get { return result.Proto2; }
        set { SetProto2(value); }
      }
      public Builder SetProto2(global::Google.ProtocolBuffers.TestProtos.TestRequired value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        result.hasProto2 = true;
        result.proto2_ = value;
        return this;
      }
      public Builder SetProto2(global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        PrepareBuilder();
        result.hasProto2 = true;
        result.proto2_ = builderForValue.Build();
        return this;
      }
      public Builder MergeProto2(global::Google.ProtocolBuffers.TestProtos.TestRequired value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        PrepareBuilder();
        if (result.hasProto2 &&
            result.proto2_ != global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance) {
            result.proto2_ = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder(result.proto2_).MergeFrom(value).BuildPartial();
        } else {
          result.proto2_ = value;
        }
        result.hasProto2 = true;
        return this;
      }
      public Builder ClearProto2() {
        PrepareBuilder();
        result.hasProto2 = false;
        result.proto2_ = null;
        return this;
      }
    }
    static TestProto2Required() {
      object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.Descriptor, null);
    }
  }

  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class ForeignMessage : pb::GeneratedMessage<ForeignMessage, ForeignMessage.Builder> {
    private ForeignMessage() { }
    private static readonly ForeignMessage defaultInstance = new ForeignMessage().MakeReadOnly();
    private static readonly string[] _foreignMessageFieldNames = new string[] { "c" };
    private static readonly uint[] _foreignMessageFieldTags = new uint[] { 8 };
    public static ForeignMessage DefaultInstance {
      get { return defaultInstance; }
    }

    public override ForeignMessage DefaultInstanceForType {
      get { return DefaultInstance; }
    }

    protected override ForeignMessage ThisMessage {
      get { return this; }
    }

    public static pbd::MessageDescriptor Descriptor {
      get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_ForeignMessage__Descriptor; }
    }

    protected override pb::FieldAccess.FieldAccessorTable<ForeignMessage, ForeignMessage.Builder> InternalFieldAccessors {
      get { return global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.internal__static_proto2_nofieldpresence_unittest_ForeignMessage__FieldAccessorTable; }
    }

    public const int CFieldNumber = 1;
    private int c_;
    public int C {
      get { return c_; }
    }

    public override void WriteTo(pb::ICodedOutputStream output) {
      CalcSerializedSize();
      string[] field_names = _foreignMessageFieldNames;
      if (C != 0) {
        output.WriteInt32(1, field_names[0], C);
      }
      UnknownFields.WriteTo(output);
    }

    private int memoizedSerializedSize = -1;
    public override int SerializedSize {
      get {
        int size = memoizedSerializedSize;
        if (size != -1) return size;
        return CalcSerializedSize();
      }
    }

    private int CalcSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (C != 0) {
        size += pb::CodedOutputStream.ComputeInt32Size(1, C);
      }
      size += UnknownFields.SerializedSize;
      memoizedSerializedSize = size;
      return size;
    }
    public static ForeignMessage ParseFrom(pb::ByteString data) {
      return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
    }
    public static ForeignMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
    }
    public static ForeignMessage ParseFrom(byte[] data) {
      return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
    }
    public static ForeignMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
    }
    public static ForeignMessage ParseFrom(global::System.IO.Stream input) {
      return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
    }
    public static ForeignMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
    }
    public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input) {
      return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
    }
    public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
      return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
    }
    public static ForeignMessage ParseFrom(pb::ICodedInputStream input) {
      return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
    }
    public static ForeignMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
    }
    private ForeignMessage MakeReadOnly() {
      return this;
    }

    public static Builder CreateBuilder() { return new Builder(); }
    public override Builder ToBuilder() { return CreateBuilder(this); }
    public override Builder CreateBuilderForType() { return new Builder(); }
    public static Builder CreateBuilder(ForeignMessage prototype) {
      return new Builder(prototype);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    public sealed partial class Builder : pb::GeneratedBuilder<ForeignMessage, Builder> {
      protected override Builder ThisBuilder {
        get { return this; }
      }
      public Builder() {
        result = DefaultInstance;
        resultIsReadOnly = true;
      }
      internal Builder(ForeignMessage cloneFrom) {
        result = cloneFrom;
        resultIsReadOnly = true;
      }

      private bool resultIsReadOnly;
      private ForeignMessage result;

      private ForeignMessage PrepareBuilder() {
        if (resultIsReadOnly) {
          ForeignMessage original = result;
          result = new ForeignMessage();
          resultIsReadOnly = false;
          MergeFrom(original);
        }
        return result;
      }

      public override bool IsInitialized {
        get { return result.IsInitialized; }
      }

      protected override ForeignMessage MessageBeingBuilt {
        get { return PrepareBuilder(); }
      }

      public override Builder Clear() {
        result = DefaultInstance;
        resultIsReadOnly = true;
        return this;
      }

      public override Builder Clone() {
        if (resultIsReadOnly) {
          return new Builder(result);
        } else {
          return new Builder().MergeFrom(result);
        }
      }

      public override pbd::MessageDescriptor DescriptorForType {
        get { return global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.Descriptor; }
      }

      public override ForeignMessage DefaultInstanceForType {
        get { return global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance; }
      }

      public override ForeignMessage BuildPartial() {
        if (resultIsReadOnly) {
          return result;
        }
        resultIsReadOnly = true;
        return result.MakeReadOnly();
      }

      public override Builder MergeFrom(pb::IMessage other) {
        if (other is ForeignMessage) {
          return MergeFrom((ForeignMessage) other);
        } else {
          base.MergeFrom(other);
          return this;
        }
      }

      public override Builder MergeFrom(ForeignMessage other) {
        if (other == global::Google.ProtocolBuffers.TestProtos.Proto3.ForeignMessage.DefaultInstance) return this;
        PrepareBuilder();
        if (other.C != 0) {
          C = other.C;
        }
        this.MergeUnknownFields(other.UnknownFields);
        return this;
      }

      public override Builder MergeFrom(pb::ICodedInputStream input) {
        return MergeFrom(input, pb::ExtensionRegistry.Empty);
      }

      public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
        PrepareBuilder();
        pb::UnknownFieldSet.Builder unknownFields = null;
        uint tag;
        string field_name;
        while (input.ReadTag(out tag, out field_name)) {
          if(tag == 0 && field_name != null) {
            int field_ordinal = global::System.Array.BinarySearch(_foreignMessageFieldNames, field_name, global::System.StringComparer.Ordinal);
            if(field_ordinal >= 0)
              tag = _foreignMessageFieldTags[field_ordinal];
            else {
              if (unknownFields == null) {
                unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
              }
              ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
              continue;
            }
          }
          switch (tag) {
            case 0: {
              throw pb::InvalidProtocolBufferException.InvalidTag();
            }
            default: {
              if (pb::WireFormat.IsEndGroupTag(tag)) {
                if (unknownFields != null) {
                  this.UnknownFields = unknownFields.Build();
                }
                return this;
              }
              if (unknownFields == null) {
                unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
              }
              ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
              break;
            }
            case 8: {
              input.ReadInt32(ref result.c_);
              break;
            }
          }
        }

        if (unknownFields != null) {
          this.UnknownFields = unknownFields.Build();
        }
        return this;
      }


      public int C {
        get { return result.C; }
        set { SetC(value); }
      }
      public Builder SetC(int value) {
        PrepareBuilder();
        result.c_ = value;
        return this;
      }
      public Builder ClearC() {
        PrepareBuilder();
        result.c_ = 0;
        return this;
      }
    }
    static ForeignMessage() {
      object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.Proto3.UnittestNoFieldPresence.Descriptor, null);
    }
  }

  #endregion

}

#endregion Designer generated code