aboutsummaryrefslogtreecommitdiff
path: root/src/protobuf/wkt/wrappers_pb.nim
blob: 873fcb7efd44dae9bd3acb0d06ba4e815d2628b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
# Generated by protoc_gen_nim. Do not edit!

import intsets

import protobuf/protobuf

type
    google_protobuf_DoubleValue* = ref google_protobuf_DoubleValueObj
    google_protobuf_DoubleValueObj* = object of RootObj
        hasField: IntSet
        value: float64
    google_protobuf_FloatValue* = ref google_protobuf_FloatValueObj
    google_protobuf_FloatValueObj* = object of RootObj
        hasField: IntSet
        value: float32
    google_protobuf_Int64Value* = ref google_protobuf_Int64ValueObj
    google_protobuf_Int64ValueObj* = object of RootObj
        hasField: IntSet
        value: int64
    google_protobuf_UInt64Value* = ref google_protobuf_UInt64ValueObj
    google_protobuf_UInt64ValueObj* = object of RootObj
        hasField: IntSet
        value: uint64
    google_protobuf_Int32Value* = ref google_protobuf_Int32ValueObj
    google_protobuf_Int32ValueObj* = object of RootObj
        hasField: IntSet
        value: int32
    google_protobuf_UInt32Value* = ref google_protobuf_UInt32ValueObj
    google_protobuf_UInt32ValueObj* = object of RootObj
        hasField: IntSet
        value: uint32
    google_protobuf_BoolValue* = ref google_protobuf_BoolValueObj
    google_protobuf_BoolValueObj* = object of RootObj
        hasField: IntSet
        value: bool
    google_protobuf_StringValue* = ref google_protobuf_StringValueObj
    google_protobuf_StringValueObj* = object of RootObj
        hasField: IntSet
        value: string
    google_protobuf_BytesValue* = ref google_protobuf_BytesValueObj
    google_protobuf_BytesValueObj* = object of RootObj
        hasField: IntSet
        value: bytes

proc newgoogle_protobuf_Int32Value*(): google_protobuf_Int32Value
proc writegoogle_protobuf_Int32Value*(stream: ProtobufStream, message: google_protobuf_Int32Value)
proc readgoogle_protobuf_Int32Value*(stream: ProtobufStream): google_protobuf_Int32Value
proc sizeOfgoogle_protobuf_Int32Value*(message: google_protobuf_Int32Value): uint64

proc newgoogle_protobuf_Int64Value*(): google_protobuf_Int64Value
proc writegoogle_protobuf_Int64Value*(stream: ProtobufStream, message: google_protobuf_Int64Value)
proc readgoogle_protobuf_Int64Value*(stream: ProtobufStream): google_protobuf_Int64Value
proc sizeOfgoogle_protobuf_Int64Value*(message: google_protobuf_Int64Value): uint64

proc newgoogle_protobuf_DoubleValue*(): google_protobuf_DoubleValue
proc writegoogle_protobuf_DoubleValue*(stream: ProtobufStream, message: google_protobuf_DoubleValue)
proc readgoogle_protobuf_DoubleValue*(stream: ProtobufStream): google_protobuf_DoubleValue
proc sizeOfgoogle_protobuf_DoubleValue*(message: google_protobuf_DoubleValue): uint64

proc newgoogle_protobuf_StringValue*(): google_protobuf_StringValue
proc writegoogle_protobuf_StringValue*(stream: ProtobufStream, message: google_protobuf_StringValue)
proc readgoogle_protobuf_StringValue*(stream: ProtobufStream): google_protobuf_StringValue
proc sizeOfgoogle_protobuf_StringValue*(message: google_protobuf_StringValue): uint64

proc newgoogle_protobuf_BoolValue*(): google_protobuf_BoolValue
proc writegoogle_protobuf_BoolValue*(stream: ProtobufStream, message: google_protobuf_BoolValue)
proc readgoogle_protobuf_BoolValue*(stream: ProtobufStream): google_protobuf_BoolValue
proc sizeOfgoogle_protobuf_BoolValue*(message: google_protobuf_BoolValue): uint64

proc newgoogle_protobuf_BytesValue*(): google_protobuf_BytesValue
proc writegoogle_protobuf_BytesValue*(stream: ProtobufStream, message: google_protobuf_BytesValue)
proc readgoogle_protobuf_BytesValue*(stream: ProtobufStream): google_protobuf_BytesValue
proc sizeOfgoogle_protobuf_BytesValue*(message: google_protobuf_BytesValue): uint64

proc newgoogle_protobuf_FloatValue*(): google_protobuf_FloatValue
proc writegoogle_protobuf_FloatValue*(stream: ProtobufStream, message: google_protobuf_FloatValue)
proc readgoogle_protobuf_FloatValue*(stream: ProtobufStream): google_protobuf_FloatValue
proc sizeOfgoogle_protobuf_FloatValue*(message: google_protobuf_FloatValue): uint64

proc newgoogle_protobuf_UInt64Value*(): google_protobuf_UInt64Value
proc writegoogle_protobuf_UInt64Value*(stream: ProtobufStream, message: google_protobuf_UInt64Value)
proc readgoogle_protobuf_UInt64Value*(stream: ProtobufStream): google_protobuf_UInt64Value
proc sizeOfgoogle_protobuf_UInt64Value*(message: google_protobuf_UInt64Value): uint64

proc newgoogle_protobuf_UInt32Value*(): google_protobuf_UInt32Value
proc writegoogle_protobuf_UInt32Value*(stream: ProtobufStream, message: google_protobuf_UInt32Value)
proc readgoogle_protobuf_UInt32Value*(stream: ProtobufStream): google_protobuf_UInt32Value
proc sizeOfgoogle_protobuf_UInt32Value*(message: google_protobuf_UInt32Value): uint64

proc newgoogle_protobuf_Int32Value*(): google_protobuf_Int32Value =
    new(result)
    result.hasField = initIntSet()
    result.value = 0

proc clearvalue*(message: google_protobuf_Int32Value) =
    message.value = 0
    excl(message.hasField, 1)

proc hasvalue*(message: google_protobuf_Int32Value): bool =
    result = contains(message.hasField, 1)

proc setvalue*(message: google_protobuf_Int32Value, value: int32) =
    message.value = value
    incl(message.hasField, 1)

proc value*(message: google_protobuf_Int32Value): int32 {.inline.} =
    message.value

proc `value=`*(message: google_protobuf_Int32Value, value: int32) {.inline.} =
    setvalue(message, value)

proc sizeOfgoogle_protobuf_Int32Value*(message: google_protobuf_Int32Value): uint64 =
    if hasvalue(message):
        let
            sizeOfField = sizeOfInt32(message.value)
            sizeOfTag = sizeOfUInt32(uint32(makeTag(1, WireType.Varint)))
        result = result + sizeOfField + sizeOfTag

proc writegoogle_protobuf_Int32Value*(stream: ProtobufStream, message: google_protobuf_Int32Value) =
    if hasvalue(message):
        writeTag(stream, 1, WireType.Varint)
        writeInt32(stream, message.value)

proc readgoogle_protobuf_Int32Value*(stream: ProtobufStream): google_protobuf_Int32Value =
    result = newgoogle_protobuf_Int32Value()
    while not atEnd(stream):
        let
            tag = readTag(stream)
            wireType = getTagWireType(tag)
        case getTagFieldNumber(tag)
        of 0:
            raise newException(InvalidFieldNumberError, "Invalid field number: 0")
        of 1:
            expectWireType(wireType, WireType.Varint)
            setvalue(result, readInt32(stream))
        else: skipField(stream, wireType)

proc serialize*(message: google_protobuf_Int32Value): string =
    let
        ss = newStringStream()
        pbs = newProtobufStream(ss)
    writegoogle_protobuf_Int32Value(pbs, message)
    result = ss.data

proc newgoogle_protobuf_Int32Value*(data: string): google_protobuf_Int32Value =
    let
        ss = newStringStream(data)
        pbs = newProtobufStream(ss)
    result = readgoogle_protobuf_Int32Value(pbs)


proc newgoogle_protobuf_Int64Value*(): google_protobuf_Int64Value =
    new(result)
    result.hasField = initIntSet()
    result.value = 0

proc clearvalue*(message: google_protobuf_Int64Value) =
    message.value = 0
    excl(message.hasField, 1)

proc hasvalue*(message: google_protobuf_Int64Value): bool =
    result = contains(message.hasField, 1)

proc setvalue*(message: google_protobuf_Int64Value, value: int64) =
    message.value = value
    incl(message.hasField, 1)

proc value*(message: google_protobuf_Int64Value): int64 {.inline.} =
    message.value

proc `value=`*(message: google_protobuf_Int64Value, value: int64) {.inline.} =
    setvalue(message, value)

proc sizeOfgoogle_protobuf_Int64Value*(message: google_protobuf_Int64Value): uint64 =
    if hasvalue(message):
        let
            sizeOfField = sizeOfInt64(message.value)
            sizeOfTag = sizeOfUInt32(uint32(makeTag(1, WireType.Varint)))
        result = result + sizeOfField + sizeOfTag

proc writegoogle_protobuf_Int64Value*(stream: ProtobufStream, message: google_protobuf_Int64Value) =
    if hasvalue(message):
        writeTag(stream, 1, WireType.Varint)
        writeInt64(stream, message.value)

proc readgoogle_protobuf_Int64Value*(stream: ProtobufStream): google_protobuf_Int64Value =
    result = newgoogle_protobuf_Int64Value()
    while not atEnd(stream):
        let
            tag = readTag(stream)
            wireType = getTagWireType(tag)
        case getTagFieldNumber(tag)
        of 0:
            raise newException(InvalidFieldNumberError, "Invalid field number: 0")
        of 1:
            expectWireType(wireType, WireType.Varint)
            setvalue(result, readInt64(stream))
        else: skipField(stream, wireType)

proc serialize*(message: google_protobuf_Int64Value): string =
    let
        ss = newStringStream()
        pbs = newProtobufStream(ss)
    writegoogle_protobuf_Int64Value(pbs, message)
    result = ss.data

proc newgoogle_protobuf_Int64Value*(data: string): google_protobuf_Int64Value =
    let
        ss = newStringStream(data)
        pbs = newProtobufStream(ss)
    result = readgoogle_protobuf_Int64Value(pbs)


proc newgoogle_protobuf_DoubleValue*(): google_protobuf_DoubleValue =
    new(result)
    result.hasField = initIntSet()
    result.value = 0

proc clearvalue*(message: google_protobuf_DoubleValue) =
    message.value = 0
    excl(message.hasField, 1)

proc hasvalue*(message: google_protobuf_DoubleValue): bool =
    result = contains(message.hasField, 1)

proc setvalue*(message: google_protobuf_DoubleValue, value: float64) =
    message.value = value
    incl(message.hasField, 1)

proc value*(message: google_protobuf_DoubleValue): float64 {.inline.} =
    message.value

proc `value=`*(message: google_protobuf_DoubleValue, value: float64) {.inline.} =
    setvalue(message, value)

proc sizeOfgoogle_protobuf_DoubleValue*(message: google_protobuf_DoubleValue): uint64 =
    if hasvalue(message):
        let
            sizeOfField = sizeOfDouble(message.value)
            sizeOfTag = sizeOfUInt32(uint32(makeTag(1, WireType.Fixed64)))
        result = result + sizeOfField + sizeOfTag

proc writegoogle_protobuf_DoubleValue*(stream: ProtobufStream, message: google_protobuf_DoubleValue) =
    if hasvalue(message):
        writeTag(stream, 1, WireType.Fixed64)
        writeDouble(stream, message.value)

proc readgoogle_protobuf_DoubleValue*(stream: ProtobufStream): google_protobuf_DoubleValue =
    result = newgoogle_protobuf_DoubleValue()
    while not atEnd(stream):
        let
            tag = readTag(stream)
            wireType = getTagWireType(tag)
        case getTagFieldNumber(tag)
        of 0:
            raise newException(InvalidFieldNumberError, "Invalid field number: 0")
        of 1:
            expectWireType(wireType, WireType.Fixed64)
            setvalue(result, readDouble(stream))
        else: skipField(stream, wireType)

proc serialize*(message: google_protobuf_DoubleValue): string =
    let
        ss = newStringStream()
        pbs = newProtobufStream(ss)
    writegoogle_protobuf_DoubleValue(pbs, message)
    result = ss.data

proc newgoogle_protobuf_DoubleValue*(data: string): google_protobuf_DoubleValue =
    let
        ss = newStringStream(data)
        pbs = newProtobufStream(ss)
    result = readgoogle_protobuf_DoubleValue(pbs)


proc newgoogle_protobuf_StringValue*(): google_protobuf_StringValue =
    new(result)
    result.hasField = initIntSet()
    result.value = ""

proc clearvalue*(message: google_protobuf_StringValue) =
    message.value = ""
    excl(message.hasField, 1)

proc hasvalue*(message: google_protobuf_StringValue): bool =
    result = contains(message.hasField, 1)

proc setvalue*(message: google_protobuf_StringValue, value: string) =
    message.value = value
    incl(message.hasField, 1)

proc value*(message: google_protobuf_StringValue): string {.inline.} =
    message.value

proc `value=`*(message: google_protobuf_StringValue, value: string) {.inline.} =
    setvalue(message, value)

proc sizeOfgoogle_protobuf_StringValue*(message: google_protobuf_StringValue): uint64 =
    if hasvalue(message):
        let
            sizeOfField = sizeOfString(message.value)
            sizeOfTag = sizeOfUInt32(uint32(makeTag(1, WireType.LengthDelimited)))
        result = result + sizeOfField + sizeOfTag

proc writegoogle_protobuf_StringValue*(stream: ProtobufStream, message: google_protobuf_StringValue) =
    if hasvalue(message):
        writeTag(stream, 1, WireType.LengthDelimited)
        writeString(stream, message.value)

proc readgoogle_protobuf_StringValue*(stream: ProtobufStream): google_protobuf_StringValue =
    result = newgoogle_protobuf_StringValue()
    while not atEnd(stream):
        let
            tag = readTag(stream)
            wireType = getTagWireType(tag)
        case getTagFieldNumber(tag)
        of 0:
            raise newException(InvalidFieldNumberError, "Invalid field number: 0")
        of 1:
            expectWireType(wireType, WireType.LengthDelimited)
            setvalue(result, readString(stream))
        else: skipField(stream, wireType)

proc serialize*(message: google_protobuf_StringValue): string =
    let
        ss = newStringStream()
        pbs = newProtobufStream(ss)
    writegoogle_protobuf_StringValue(pbs, message)
    result = ss.data

proc newgoogle_protobuf_StringValue*(data: string): google_protobuf_StringValue =
    let
        ss = newStringStream(data)
        pbs = newProtobufStream(ss)
    result = readgoogle_protobuf_StringValue(pbs)


proc newgoogle_protobuf_BoolValue*(): google_protobuf_BoolValue =
    new(result)
    result.hasField = initIntSet()
    result.value = false

proc clearvalue*(message: google_protobuf_BoolValue) =
    message.value = false
    excl(message.hasField, 1)

proc hasvalue*(message: google_protobuf_BoolValue): bool =
    result = contains(message.hasField, 1)

proc setvalue*(message: google_protobuf_BoolValue, value: bool) =
    message.value = value
    incl(message.hasField, 1)

proc value*(message: google_protobuf_BoolValue): bool {.inline.} =
    message.value

proc `value=`*(message: google_protobuf_BoolValue, value: bool) {.inline.} =
    setvalue(message, value)

proc sizeOfgoogle_protobuf_BoolValue*(message: google_protobuf_BoolValue): uint64 =
    if hasvalue(message):
        let
            sizeOfField = sizeOfBool(message.value)
            sizeOfTag = sizeOfUInt32(uint32(makeTag(1, WireType.Varint)))
        result = result + sizeOfField + sizeOfTag

proc writegoogle_protobuf_BoolValue*(stream: ProtobufStream, message: google_protobuf_BoolValue) =
    if hasvalue(message):
        writeTag(stream, 1, WireType.Varint)
        writeBool(stream, message.value)

proc readgoogle_protobuf_BoolValue*(stream: ProtobufStream): google_protobuf_BoolValue =
    result = newgoogle_protobuf_BoolValue()
    while not atEnd(stream):
        let
            tag = readTag(stream)
            wireType = getTagWireType(tag)
        case getTagFieldNumber(tag)
        of 0:
            raise newException(InvalidFieldNumberError, "Invalid field number: 0")
        of 1:
            expectWireType(wireType, WireType.Varint)
            setvalue(result, readBool(stream))
        else: skipField(stream, wireType)

proc serialize*(message: google_protobuf_BoolValue): string =
    let
        ss = newStringStream()
        pbs = newProtobufStream(ss)
    writegoogle_protobuf_BoolValue(pbs, message)
    result = ss.data

proc newgoogle_protobuf_BoolValue*(data: string): google_protobuf_BoolValue =
    let
        ss = newStringStream(data)
        pbs = newProtobufStream(ss)
    result = readgoogle_protobuf_BoolValue(pbs)


proc newgoogle_protobuf_BytesValue*(): google_protobuf_BytesValue =
    new(result)
    result.hasField = initIntSet()
    result.value = bytes("")

proc clearvalue*(message: google_protobuf_BytesValue) =
    message.value = bytes("")
    excl(message.hasField, 1)

proc hasvalue*(message: google_protobuf_BytesValue): bool =
    result = contains(message.hasField, 1)

proc setvalue*(message: google_protobuf_BytesValue, value: bytes) =
    message.value = value
    incl(message.hasField, 1)

proc value*(message: google_protobuf_BytesValue): bytes {.inline.} =
    message.value

proc `value=`*(message: google_protobuf_BytesValue, value: bytes) {.inline.} =
    setvalue(message, value)

proc sizeOfgoogle_protobuf_BytesValue*(message: google_protobuf_BytesValue): uint64 =
    if hasvalue(message):
        let
            sizeOfField = sizeOfBytes(message.value)
            sizeOfTag = sizeOfUInt32(uint32(makeTag(1, WireType.LengthDelimited)))
        result = result + sizeOfField + sizeOfTag

proc writegoogle_protobuf_BytesValue*(stream: ProtobufStream, message: google_protobuf_BytesValue) =
    if hasvalue(message):
        writeTag(stream, 1, WireType.LengthDelimited)
        writeBytes(stream, message.value)

proc readgoogle_protobuf_BytesValue*(stream: ProtobufStream): google_protobuf_BytesValue =
    result = newgoogle_protobuf_BytesValue()
    while not atEnd(stream):
        let
            tag = readTag(stream)
            wireType = getTagWireType(tag)
        case getTagFieldNumber(tag)
        of 0:
            raise newException(InvalidFieldNumberError, "Invalid field number: 0")
        of 1:
            expectWireType(wireType, WireType.LengthDelimited)
            setvalue(result, readBytes(stream))
        else: skipField(stream, wireType)

proc serialize*(message: google_protobuf_BytesValue): string =
    let
        ss = newStringStream()
        pbs = newProtobufStream(ss)
    writegoogle_protobuf_BytesValue(pbs, message)
    result = ss.data

proc newgoogle_protobuf_BytesValue*(data: string): google_protobuf_BytesValue =
    let
        ss = newStringStream(data)
        pbs = newProtobufStream(ss)
    result = readgoogle_protobuf_BytesValue(pbs)


proc newgoogle_protobuf_FloatValue*(): google_protobuf_FloatValue =
    new(result)
    result.hasField = initIntSet()
    result.value = 0

proc clearvalue*(message: google_protobuf_FloatValue) =
    message.value = 0
    excl(message.hasField, 1)

proc hasvalue*(message: google_protobuf_FloatValue): bool =
    result = contains(message.hasField, 1)

proc setvalue*(message: google_protobuf_FloatValue, value: float32) =
    message.value = value
    incl(message.hasField, 1)

proc value*(message: google_protobuf_FloatValue): float32 {.inline.} =
    message.value

proc `value=`*(message: google_protobuf_FloatValue, value: float32) {.inline.} =
    setvalue(message, value)

proc sizeOfgoogle_protobuf_FloatValue*(message: google_protobuf_FloatValue): uint64 =
    if hasvalue(message):
        let
            sizeOfField = sizeOfFloat(message.value)
            sizeOfTag = sizeOfUInt32(uint32(makeTag(1, WireType.Fixed32)))
        result = result + sizeOfField + sizeOfTag

proc writegoogle_protobuf_FloatValue*(stream: ProtobufStream, message: google_protobuf_FloatValue) =
    if hasvalue(message):
        writeTag(stream, 1, WireType.Fixed32)
        writeFloat(stream, message.value)

proc readgoogle_protobuf_FloatValue*(stream: ProtobufStream): google_protobuf_FloatValue =
    result = newgoogle_protobuf_FloatValue()
    while not atEnd(stream):
        let
            tag = readTag(stream)
            wireType = getTagWireType(tag)
        case getTagFieldNumber(tag)
        of 0:
            raise newException(InvalidFieldNumberError, "Invalid field number: 0")
        of 1:
            expectWireType(wireType, WireType.Fixed32)
            setvalue(result, readFloat(stream))
        else: skipField(stream, wireType)

proc serialize*(message: google_protobuf_FloatValue): string =
    let
        ss = newStringStream()
        pbs = newProtobufStream(ss)
    writegoogle_protobuf_FloatValue(pbs, message)
    result = ss.data

proc newgoogle_protobuf_FloatValue*(data: string): google_protobuf_FloatValue =
    let
        ss = newStringStream(data)
        pbs = newProtobufStream(ss)
    result = readgoogle_protobuf_FloatValue(pbs)


proc newgoogle_protobuf_UInt64Value*(): google_protobuf_UInt64Value =
    new(result)
    result.hasField = initIntSet()
    result.value = 0

proc clearvalue*(message: google_protobuf_UInt64Value) =
    message.value = 0
    excl(message.hasField, 1)

proc hasvalue*(message: google_protobuf_UInt64Value): bool =
    result = contains(message.hasField, 1)

proc setvalue*(message: google_protobuf_UInt64Value, value: uint64) =
    message.value = value
    incl(message.hasField, 1)

proc value*(message: google_protobuf_UInt64Value): uint64 {.inline.} =
    message.value

proc `value=`*(message: google_protobuf_UInt64Value, value: uint64) {.inline.} =
    setvalue(message, value)

proc sizeOfgoogle_protobuf_UInt64Value*(message: google_protobuf_UInt64Value): uint64 =
    if hasvalue(message):
        let
            sizeOfField = sizeOfUInt64(message.value)
            sizeOfTag = sizeOfUInt32(uint32(makeTag(1, WireType.Varint)))
        result = result + sizeOfField + sizeOfTag

proc writegoogle_protobuf_UInt64Value*(stream: ProtobufStream, message: google_protobuf_UInt64Value) =
    if hasvalue(message):
        writeTag(stream, 1, WireType.Varint)
        writeUInt64(stream, message.value)

proc readgoogle_protobuf_UInt64Value*(stream: ProtobufStream): google_protobuf_UInt64Value =
    result = newgoogle_protobuf_UInt64Value()
    while not atEnd(stream):
        let
            tag = readTag(stream)
            wireType = getTagWireType(tag)
        case getTagFieldNumber(tag)
        of 0:
            raise newException(InvalidFieldNumberError, "Invalid field number: 0")
        of 1:
            expectWireType(wireType, WireType.Varint)
            setvalue(result, readUInt64(stream))
        else: skipField(stream, wireType)

proc serialize*(message: google_protobuf_UInt64Value): string =
    let
        ss = newStringStream()
        pbs = newProtobufStream(ss)
    writegoogle_protobuf_UInt64Value(pbs, message)
    result = ss.data

proc newgoogle_protobuf_UInt64Value*(data: string): google_protobuf_UInt64Value =
    let
        ss = newStringStream(data)
        pbs = newProtobufStream(ss)
    result = readgoogle_protobuf_UInt64Value(pbs)


proc newgoogle_protobuf_UInt32Value*(): google_protobuf_UInt32Value =
    new(result)
    result.hasField = initIntSet()
    result.value = 0

proc clearvalue*(message: google_protobuf_UInt32Value) =
    message.value = 0
    excl(message.hasField, 1)

proc hasvalue*(message: google_protobuf_UInt32Value): bool =
    result = contains(message.hasField, 1)

proc setvalue*(message: google_protobuf_UInt32Value, value: uint32) =
    message.value = value
    incl(message.hasField, 1)

proc value*(message: google_protobuf_UInt32Value): uint32 {.inline.} =
    message.value

proc `value=`*(message: google_protobuf_UInt32Value, value: uint32) {.inline.} =
    setvalue(message, value)

proc sizeOfgoogle_protobuf_UInt32Value*(message: google_protobuf_UInt32Value): uint64 =
    if hasvalue(message):
        let
            sizeOfField = sizeOfUInt32(message.value)
            sizeOfTag = sizeOfUInt32(uint32(makeTag(1, WireType.Varint)))
        result = result + sizeOfField + sizeOfTag

proc writegoogle_protobuf_UInt32Value*(stream: ProtobufStream, message: google_protobuf_UInt32Value) =
    if hasvalue(message):
        writeTag(stream, 1, WireType.Varint)
        writeUInt32(stream, message.value)

proc readgoogle_protobuf_UInt32Value*(stream: ProtobufStream): google_protobuf_UInt32Value =
    result = newgoogle_protobuf_UInt32Value()
    while not atEnd(stream):
        let
            tag = readTag(stream)
            wireType = getTagWireType(tag)
        case getTagFieldNumber(tag)
        of 0:
            raise newException(InvalidFieldNumberError, "Invalid field number: 0")
        of 1:
            expectWireType(wireType, WireType.Varint)
            setvalue(result, readUInt32(stream))
        else: skipField(stream, wireType)

proc serialize*(message: google_protobuf_UInt32Value): string =
    let
        ss = newStringStream()
        pbs = newProtobufStream(ss)
    writegoogle_protobuf_UInt32Value(pbs, message)
    result = ss.data

proc newgoogle_protobuf_UInt32Value*(data: string): google_protobuf_UInt32Value =
    let
        ss = newStringStream(data)
        pbs = newProtobufStream(ss)
    result = readgoogle_protobuf_UInt32Value(pbs)