3 # Copyright 2007 Google Inc.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
20 from google
.net
.proto
import ProtocolBuffer
22 import dummy_thread
as thread
24 __pychecker__
= """maxreturns=0 maxbranches=0 no-callinit
25 unusednames=printElemNumber,debug_strs no-special"""
27 if hasattr(ProtocolBuffer
, 'ExtendableProtocolMessage'):
28 _extension_runtime
= True
29 _ExtendableProtocolMessage
= ProtocolBuffer
.ExtendableProtocolMessage
31 _extension_runtime
= False
32 _ExtendableProtocolMessage
= ProtocolBuffer
.ProtocolMessage
34 class ImagesServiceError(ProtocolBuffer
.ProtocolMessage
):
38 BAD_TRANSFORM_DATA
= 2
47 1: "UNSPECIFIED_ERROR",
48 2: "BAD_TRANSFORM_DATA",
52 6: "INVALID_BLOB_KEY",
54 8: "OBJECT_NOT_FOUND",
57 def ErrorCode_Name(cls
, x
): return cls
._ErrorCode
_NAMES
.get(x
, "")
58 ErrorCode_Name
= classmethod(ErrorCode_Name
)
61 def __init__(self
, contents
=None):
63 if contents
is not None: self
.MergeFromString(contents
)
66 def MergeFrom(self
, x
):
70 if x
is self
: return 1
73 def IsInitialized(self
, debug_strs
=None):
81 def ByteSizePartial(self
):
88 def OutputUnchecked(self
, out
):
91 def OutputPartial(self
, out
):
94 def TryMerge(self
, d
):
99 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
103 def __str__(self
, prefix
="", printElemNumber
=0):
108 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
109 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
112 _TEXT
= _BuildTagLookupTable({
116 _TYPES
= _BuildTagLookupTable({
117 0: ProtocolBuffer
.Encoder
.NUMERIC
,
118 }, 0, ProtocolBuffer
.Encoder
.MAX_TYPE
)
122 _STYLE_CONTENT_TYPE
= """"""
123 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImagesServiceError'
124 class ImagesServiceTransform(ProtocolBuffer
.ProtocolMessage
):
137 3: "HORIZONTAL_FLIP",
140 6: "IM_FEELING_LUCKY",
143 def Type_Name(cls
, x
): return cls
._Type
_NAMES
.get(x
, "")
144 Type_Name
= classmethod(Type_Name
)
147 def __init__(self
, contents
=None):
149 if contents
is not None: self
.MergeFromString(contents
)
152 def MergeFrom(self
, x
):
156 if x
is self
: return 1
159 def IsInitialized(self
, debug_strs
=None):
167 def ByteSizePartial(self
):
174 def OutputUnchecked(self
, out
):
177 def OutputPartial(self
, out
):
180 def TryMerge(self
, d
):
185 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
189 def __str__(self
, prefix
="", printElemNumber
=0):
194 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
195 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
198 _TEXT
= _BuildTagLookupTable({
202 _TYPES
= _BuildTagLookupTable({
203 0: ProtocolBuffer
.Encoder
.NUMERIC
,
204 }, 0, ProtocolBuffer
.Encoder
.MAX_TYPE
)
208 _STYLE_CONTENT_TYPE
= """"""
209 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImagesServiceTransform'
210 class Transform(ProtocolBuffer
.ProtocolMessage
):
217 has_crop_offset_x_
= 0
219 has_crop_offset_y_
= 0
223 has_horizontal_flip_
= 0
225 has_vertical_flip_
= 0
231 has_crop_right_x_
= 0
233 has_crop_bottom_y_
= 0
237 has_allow_stretch_
= 0
240 def __init__(self
, contents
=None):
241 if contents
is not None: self
.MergeFromString(contents
)
243 def width(self
): return self
.width_
245 def set_width(self
, x
):
249 def clear_width(self
):
254 def has_width(self
): return self
.has_width_
256 def height(self
): return self
.height_
258 def set_height(self
, x
):
262 def clear_height(self
):
267 def has_height(self
): return self
.has_height_
269 def crop_to_fit(self
): return self
.crop_to_fit_
271 def set_crop_to_fit(self
, x
):
272 self
.has_crop_to_fit_
= 1
273 self
.crop_to_fit_
= x
275 def clear_crop_to_fit(self
):
276 if self
.has_crop_to_fit_
:
277 self
.has_crop_to_fit_
= 0
278 self
.crop_to_fit_
= 0
280 def has_crop_to_fit(self
): return self
.has_crop_to_fit_
282 def crop_offset_x(self
): return self
.crop_offset_x_
284 def set_crop_offset_x(self
, x
):
285 self
.has_crop_offset_x_
= 1
286 self
.crop_offset_x_
= x
288 def clear_crop_offset_x(self
):
289 if self
.has_crop_offset_x_
:
290 self
.has_crop_offset_x_
= 0
291 self
.crop_offset_x_
= 0.5
293 def has_crop_offset_x(self
): return self
.has_crop_offset_x_
295 def crop_offset_y(self
): return self
.crop_offset_y_
297 def set_crop_offset_y(self
, x
):
298 self
.has_crop_offset_y_
= 1
299 self
.crop_offset_y_
= x
301 def clear_crop_offset_y(self
):
302 if self
.has_crop_offset_y_
:
303 self
.has_crop_offset_y_
= 0
304 self
.crop_offset_y_
= 0.5
306 def has_crop_offset_y(self
): return self
.has_crop_offset_y_
308 def rotate(self
): return self
.rotate_
310 def set_rotate(self
, x
):
314 def clear_rotate(self
):
319 def has_rotate(self
): return self
.has_rotate_
321 def horizontal_flip(self
): return self
.horizontal_flip_
323 def set_horizontal_flip(self
, x
):
324 self
.has_horizontal_flip_
= 1
325 self
.horizontal_flip_
= x
327 def clear_horizontal_flip(self
):
328 if self
.has_horizontal_flip_
:
329 self
.has_horizontal_flip_
= 0
330 self
.horizontal_flip_
= 0
332 def has_horizontal_flip(self
): return self
.has_horizontal_flip_
334 def vertical_flip(self
): return self
.vertical_flip_
336 def set_vertical_flip(self
, x
):
337 self
.has_vertical_flip_
= 1
338 self
.vertical_flip_
= x
340 def clear_vertical_flip(self
):
341 if self
.has_vertical_flip_
:
342 self
.has_vertical_flip_
= 0
343 self
.vertical_flip_
= 0
345 def has_vertical_flip(self
): return self
.has_vertical_flip_
347 def crop_left_x(self
): return self
.crop_left_x_
349 def set_crop_left_x(self
, x
):
350 self
.has_crop_left_x_
= 1
351 self
.crop_left_x_
= x
353 def clear_crop_left_x(self
):
354 if self
.has_crop_left_x_
:
355 self
.has_crop_left_x_
= 0
356 self
.crop_left_x_
= 0.0
358 def has_crop_left_x(self
): return self
.has_crop_left_x_
360 def crop_top_y(self
): return self
.crop_top_y_
362 def set_crop_top_y(self
, x
):
363 self
.has_crop_top_y_
= 1
366 def clear_crop_top_y(self
):
367 if self
.has_crop_top_y_
:
368 self
.has_crop_top_y_
= 0
369 self
.crop_top_y_
= 0.0
371 def has_crop_top_y(self
): return self
.has_crop_top_y_
373 def crop_right_x(self
): return self
.crop_right_x_
375 def set_crop_right_x(self
, x
):
376 self
.has_crop_right_x_
= 1
377 self
.crop_right_x_
= x
379 def clear_crop_right_x(self
):
380 if self
.has_crop_right_x_
:
381 self
.has_crop_right_x_
= 0
382 self
.crop_right_x_
= 1.0
384 def has_crop_right_x(self
): return self
.has_crop_right_x_
386 def crop_bottom_y(self
): return self
.crop_bottom_y_
388 def set_crop_bottom_y(self
, x
):
389 self
.has_crop_bottom_y_
= 1
390 self
.crop_bottom_y_
= x
392 def clear_crop_bottom_y(self
):
393 if self
.has_crop_bottom_y_
:
394 self
.has_crop_bottom_y_
= 0
395 self
.crop_bottom_y_
= 1.0
397 def has_crop_bottom_y(self
): return self
.has_crop_bottom_y_
399 def autolevels(self
): return self
.autolevels_
401 def set_autolevels(self
, x
):
402 self
.has_autolevels_
= 1
405 def clear_autolevels(self
):
406 if self
.has_autolevels_
:
407 self
.has_autolevels_
= 0
410 def has_autolevels(self
): return self
.has_autolevels_
412 def allow_stretch(self
): return self
.allow_stretch_
414 def set_allow_stretch(self
, x
):
415 self
.has_allow_stretch_
= 1
416 self
.allow_stretch_
= x
418 def clear_allow_stretch(self
):
419 if self
.has_allow_stretch_
:
420 self
.has_allow_stretch_
= 0
421 self
.allow_stretch_
= 0
423 def has_allow_stretch(self
): return self
.has_allow_stretch_
426 def MergeFrom(self
, x
):
428 if (x
.has_width()): self
.set_width(x
.width())
429 if (x
.has_height()): self
.set_height(x
.height())
430 if (x
.has_crop_to_fit()): self
.set_crop_to_fit(x
.crop_to_fit())
431 if (x
.has_crop_offset_x()): self
.set_crop_offset_x(x
.crop_offset_x())
432 if (x
.has_crop_offset_y()): self
.set_crop_offset_y(x
.crop_offset_y())
433 if (x
.has_rotate()): self
.set_rotate(x
.rotate())
434 if (x
.has_horizontal_flip()): self
.set_horizontal_flip(x
.horizontal_flip())
435 if (x
.has_vertical_flip()): self
.set_vertical_flip(x
.vertical_flip())
436 if (x
.has_crop_left_x()): self
.set_crop_left_x(x
.crop_left_x())
437 if (x
.has_crop_top_y()): self
.set_crop_top_y(x
.crop_top_y())
438 if (x
.has_crop_right_x()): self
.set_crop_right_x(x
.crop_right_x())
439 if (x
.has_crop_bottom_y()): self
.set_crop_bottom_y(x
.crop_bottom_y())
440 if (x
.has_autolevels()): self
.set_autolevels(x
.autolevels())
441 if (x
.has_allow_stretch()): self
.set_allow_stretch(x
.allow_stretch())
444 if x
is self
: return 1
445 if self
.has_width_
!= x
.has_width_
: return 0
446 if self
.has_width_
and self
.width_
!= x
.width_
: return 0
447 if self
.has_height_
!= x
.has_height_
: return 0
448 if self
.has_height_
and self
.height_
!= x
.height_
: return 0
449 if self
.has_crop_to_fit_
!= x
.has_crop_to_fit_
: return 0
450 if self
.has_crop_to_fit_
and self
.crop_to_fit_
!= x
.crop_to_fit_
: return 0
451 if self
.has_crop_offset_x_
!= x
.has_crop_offset_x_
: return 0
452 if self
.has_crop_offset_x_
and self
.crop_offset_x_
!= x
.crop_offset_x_
: return 0
453 if self
.has_crop_offset_y_
!= x
.has_crop_offset_y_
: return 0
454 if self
.has_crop_offset_y_
and self
.crop_offset_y_
!= x
.crop_offset_y_
: return 0
455 if self
.has_rotate_
!= x
.has_rotate_
: return 0
456 if self
.has_rotate_
and self
.rotate_
!= x
.rotate_
: return 0
457 if self
.has_horizontal_flip_
!= x
.has_horizontal_flip_
: return 0
458 if self
.has_horizontal_flip_
and self
.horizontal_flip_
!= x
.horizontal_flip_
: return 0
459 if self
.has_vertical_flip_
!= x
.has_vertical_flip_
: return 0
460 if self
.has_vertical_flip_
and self
.vertical_flip_
!= x
.vertical_flip_
: return 0
461 if self
.has_crop_left_x_
!= x
.has_crop_left_x_
: return 0
462 if self
.has_crop_left_x_
and self
.crop_left_x_
!= x
.crop_left_x_
: return 0
463 if self
.has_crop_top_y_
!= x
.has_crop_top_y_
: return 0
464 if self
.has_crop_top_y_
and self
.crop_top_y_
!= x
.crop_top_y_
: return 0
465 if self
.has_crop_right_x_
!= x
.has_crop_right_x_
: return 0
466 if self
.has_crop_right_x_
and self
.crop_right_x_
!= x
.crop_right_x_
: return 0
467 if self
.has_crop_bottom_y_
!= x
.has_crop_bottom_y_
: return 0
468 if self
.has_crop_bottom_y_
and self
.crop_bottom_y_
!= x
.crop_bottom_y_
: return 0
469 if self
.has_autolevels_
!= x
.has_autolevels_
: return 0
470 if self
.has_autolevels_
and self
.autolevels_
!= x
.autolevels_
: return 0
471 if self
.has_allow_stretch_
!= x
.has_allow_stretch_
: return 0
472 if self
.has_allow_stretch_
and self
.allow_stretch_
!= x
.allow_stretch_
: return 0
475 def IsInitialized(self
, debug_strs
=None):
481 if (self
.has_width_
): n
+= 1 + self
.lengthVarInt64(self
.width_
)
482 if (self
.has_height_
): n
+= 1 + self
.lengthVarInt64(self
.height_
)
483 if (self
.has_crop_to_fit_
): n
+= 2
484 if (self
.has_crop_offset_x_
): n
+= 5
485 if (self
.has_crop_offset_y_
): n
+= 5
486 if (self
.has_rotate_
): n
+= 1 + self
.lengthVarInt64(self
.rotate_
)
487 if (self
.has_horizontal_flip_
): n
+= 2
488 if (self
.has_vertical_flip_
): n
+= 2
489 if (self
.has_crop_left_x_
): n
+= 5
490 if (self
.has_crop_top_y_
): n
+= 5
491 if (self
.has_crop_right_x_
): n
+= 5
492 if (self
.has_crop_bottom_y_
): n
+= 5
493 if (self
.has_autolevels_
): n
+= 2
494 if (self
.has_allow_stretch_
): n
+= 2
497 def ByteSizePartial(self
):
499 if (self
.has_width_
): n
+= 1 + self
.lengthVarInt64(self
.width_
)
500 if (self
.has_height_
): n
+= 1 + self
.lengthVarInt64(self
.height_
)
501 if (self
.has_crop_to_fit_
): n
+= 2
502 if (self
.has_crop_offset_x_
): n
+= 5
503 if (self
.has_crop_offset_y_
): n
+= 5
504 if (self
.has_rotate_
): n
+= 1 + self
.lengthVarInt64(self
.rotate_
)
505 if (self
.has_horizontal_flip_
): n
+= 2
506 if (self
.has_vertical_flip_
): n
+= 2
507 if (self
.has_crop_left_x_
): n
+= 5
508 if (self
.has_crop_top_y_
): n
+= 5
509 if (self
.has_crop_right_x_
): n
+= 5
510 if (self
.has_crop_bottom_y_
): n
+= 5
511 if (self
.has_autolevels_
): n
+= 2
512 if (self
.has_allow_stretch_
): n
+= 2
518 self
.clear_crop_to_fit()
519 self
.clear_crop_offset_x()
520 self
.clear_crop_offset_y()
522 self
.clear_horizontal_flip()
523 self
.clear_vertical_flip()
524 self
.clear_crop_left_x()
525 self
.clear_crop_top_y()
526 self
.clear_crop_right_x()
527 self
.clear_crop_bottom_y()
528 self
.clear_autolevels()
529 self
.clear_allow_stretch()
531 def OutputUnchecked(self
, out
):
532 if (self
.has_width_
):
534 out
.putVarInt32(self
.width_
)
535 if (self
.has_height_
):
537 out
.putVarInt32(self
.height_
)
538 if (self
.has_rotate_
):
540 out
.putVarInt32(self
.rotate_
)
541 if (self
.has_horizontal_flip_
):
543 out
.putBoolean(self
.horizontal_flip_
)
544 if (self
.has_vertical_flip_
):
546 out
.putBoolean(self
.vertical_flip_
)
547 if (self
.has_crop_left_x_
):
549 out
.putFloat(self
.crop_left_x_
)
550 if (self
.has_crop_top_y_
):
552 out
.putFloat(self
.crop_top_y_
)
553 if (self
.has_crop_right_x_
):
555 out
.putFloat(self
.crop_right_x_
)
556 if (self
.has_crop_bottom_y_
):
558 out
.putFloat(self
.crop_bottom_y_
)
559 if (self
.has_autolevels_
):
561 out
.putBoolean(self
.autolevels_
)
562 if (self
.has_crop_to_fit_
):
564 out
.putBoolean(self
.crop_to_fit_
)
565 if (self
.has_crop_offset_x_
):
567 out
.putFloat(self
.crop_offset_x_
)
568 if (self
.has_crop_offset_y_
):
570 out
.putFloat(self
.crop_offset_y_
)
571 if (self
.has_allow_stretch_
):
573 out
.putBoolean(self
.allow_stretch_
)
575 def OutputPartial(self
, out
):
576 if (self
.has_width_
):
578 out
.putVarInt32(self
.width_
)
579 if (self
.has_height_
):
581 out
.putVarInt32(self
.height_
)
582 if (self
.has_rotate_
):
584 out
.putVarInt32(self
.rotate_
)
585 if (self
.has_horizontal_flip_
):
587 out
.putBoolean(self
.horizontal_flip_
)
588 if (self
.has_vertical_flip_
):
590 out
.putBoolean(self
.vertical_flip_
)
591 if (self
.has_crop_left_x_
):
593 out
.putFloat(self
.crop_left_x_
)
594 if (self
.has_crop_top_y_
):
596 out
.putFloat(self
.crop_top_y_
)
597 if (self
.has_crop_right_x_
):
599 out
.putFloat(self
.crop_right_x_
)
600 if (self
.has_crop_bottom_y_
):
602 out
.putFloat(self
.crop_bottom_y_
)
603 if (self
.has_autolevels_
):
605 out
.putBoolean(self
.autolevels_
)
606 if (self
.has_crop_to_fit_
):
608 out
.putBoolean(self
.crop_to_fit_
)
609 if (self
.has_crop_offset_x_
):
611 out
.putFloat(self
.crop_offset_x_
)
612 if (self
.has_crop_offset_y_
):
614 out
.putFloat(self
.crop_offset_y_
)
615 if (self
.has_allow_stretch_
):
617 out
.putBoolean(self
.allow_stretch_
)
619 def TryMerge(self
, d
):
623 self
.set_width(d
.getVarInt32())
626 self
.set_height(d
.getVarInt32())
629 self
.set_rotate(d
.getVarInt32())
632 self
.set_horizontal_flip(d
.getBoolean())
635 self
.set_vertical_flip(d
.getBoolean())
638 self
.set_crop_left_x(d
.getFloat())
641 self
.set_crop_top_y(d
.getFloat())
644 self
.set_crop_right_x(d
.getFloat())
647 self
.set_crop_bottom_y(d
.getFloat())
650 self
.set_autolevels(d
.getBoolean())
653 self
.set_crop_to_fit(d
.getBoolean())
656 self
.set_crop_offset_x(d
.getFloat())
659 self
.set_crop_offset_y(d
.getFloat())
662 self
.set_allow_stretch(d
.getBoolean())
666 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
670 def __str__(self
, prefix
="", printElemNumber
=0):
672 if self
.has_width_
: res
+=prefix
+("width: %s\n" % self
.DebugFormatInt32(self
.width_
))
673 if self
.has_height_
: res
+=prefix
+("height: %s\n" % self
.DebugFormatInt32(self
.height_
))
674 if self
.has_crop_to_fit_
: res
+=prefix
+("crop_to_fit: %s\n" % self
.DebugFormatBool(self
.crop_to_fit_
))
675 if self
.has_crop_offset_x_
: res
+=prefix
+("crop_offset_x: %s\n" % self
.DebugFormatFloat(self
.crop_offset_x_
))
676 if self
.has_crop_offset_y_
: res
+=prefix
+("crop_offset_y: %s\n" % self
.DebugFormatFloat(self
.crop_offset_y_
))
677 if self
.has_rotate_
: res
+=prefix
+("rotate: %s\n" % self
.DebugFormatInt32(self
.rotate_
))
678 if self
.has_horizontal_flip_
: res
+=prefix
+("horizontal_flip: %s\n" % self
.DebugFormatBool(self
.horizontal_flip_
))
679 if self
.has_vertical_flip_
: res
+=prefix
+("vertical_flip: %s\n" % self
.DebugFormatBool(self
.vertical_flip_
))
680 if self
.has_crop_left_x_
: res
+=prefix
+("crop_left_x: %s\n" % self
.DebugFormatFloat(self
.crop_left_x_
))
681 if self
.has_crop_top_y_
: res
+=prefix
+("crop_top_y: %s\n" % self
.DebugFormatFloat(self
.crop_top_y_
))
682 if self
.has_crop_right_x_
: res
+=prefix
+("crop_right_x: %s\n" % self
.DebugFormatFloat(self
.crop_right_x_
))
683 if self
.has_crop_bottom_y_
: res
+=prefix
+("crop_bottom_y: %s\n" % self
.DebugFormatFloat(self
.crop_bottom_y_
))
684 if self
.has_autolevels_
: res
+=prefix
+("autolevels: %s\n" % self
.DebugFormatBool(self
.autolevels_
))
685 if self
.has_allow_stretch_
: res
+=prefix
+("allow_stretch: %s\n" % self
.DebugFormatBool(self
.allow_stretch_
))
689 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
690 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
707 _TEXT
= _BuildTagLookupTable({
712 4: "horizontal_flip",
725 _TYPES
= _BuildTagLookupTable({
726 0: ProtocolBuffer
.Encoder
.NUMERIC
,
727 1: ProtocolBuffer
.Encoder
.NUMERIC
,
728 2: ProtocolBuffer
.Encoder
.NUMERIC
,
729 3: ProtocolBuffer
.Encoder
.NUMERIC
,
730 4: ProtocolBuffer
.Encoder
.NUMERIC
,
731 5: ProtocolBuffer
.Encoder
.NUMERIC
,
732 6: ProtocolBuffer
.Encoder
.FLOAT
,
733 7: ProtocolBuffer
.Encoder
.FLOAT
,
734 8: ProtocolBuffer
.Encoder
.FLOAT
,
735 9: ProtocolBuffer
.Encoder
.FLOAT
,
736 10: ProtocolBuffer
.Encoder
.NUMERIC
,
737 11: ProtocolBuffer
.Encoder
.NUMERIC
,
738 12: ProtocolBuffer
.Encoder
.FLOAT
,
739 13: ProtocolBuffer
.Encoder
.FLOAT
,
740 14: ProtocolBuffer
.Encoder
.NUMERIC
,
741 }, 14, ProtocolBuffer
.Encoder
.MAX_TYPE
)
745 _STYLE_CONTENT_TYPE
= """"""
746 _PROTO_DESCRIPTOR_NAME
= 'apphosting.Transform'
747 class ImageData(ProtocolBuffer
.ProtocolMessage
):
757 def __init__(self
, contents
=None):
758 if contents
is not None: self
.MergeFromString(contents
)
760 def content(self
): return self
.content_
762 def set_content(self
, x
):
763 self
.has_content_
= 1
766 def clear_content(self
):
767 if self
.has_content_
:
768 self
.has_content_
= 0
771 def has_content(self
): return self
.has_content_
773 def blob_key(self
): return self
.blob_key_
775 def set_blob_key(self
, x
):
776 self
.has_blob_key_
= 1
779 def clear_blob_key(self
):
780 if self
.has_blob_key_
:
781 self
.has_blob_key_
= 0
784 def has_blob_key(self
): return self
.has_blob_key_
786 def width(self
): return self
.width_
788 def set_width(self
, x
):
792 def clear_width(self
):
797 def has_width(self
): return self
.has_width_
799 def height(self
): return self
.height_
801 def set_height(self
, x
):
805 def clear_height(self
):
810 def has_height(self
): return self
.has_height_
813 def MergeFrom(self
, x
):
815 if (x
.has_content()): self
.set_content(x
.content())
816 if (x
.has_blob_key()): self
.set_blob_key(x
.blob_key())
817 if (x
.has_width()): self
.set_width(x
.width())
818 if (x
.has_height()): self
.set_height(x
.height())
821 if x
is self
: return 1
822 if self
.has_content_
!= x
.has_content_
: return 0
823 if self
.has_content_
and self
.content_
!= x
.content_
: return 0
824 if self
.has_blob_key_
!= x
.has_blob_key_
: return 0
825 if self
.has_blob_key_
and self
.blob_key_
!= x
.blob_key_
: return 0
826 if self
.has_width_
!= x
.has_width_
: return 0
827 if self
.has_width_
and self
.width_
!= x
.width_
: return 0
828 if self
.has_height_
!= x
.has_height_
: return 0
829 if self
.has_height_
and self
.height_
!= x
.height_
: return 0
832 def IsInitialized(self
, debug_strs
=None):
834 if (not self
.has_content_
):
836 if debug_strs
is not None:
837 debug_strs
.append('Required field: content not set.')
842 n
+= self
.lengthString(len(self
.content_
))
843 if (self
.has_blob_key_
): n
+= 1 + self
.lengthString(len(self
.blob_key_
))
844 if (self
.has_width_
): n
+= 1 + self
.lengthVarInt64(self
.width_
)
845 if (self
.has_height_
): n
+= 1 + self
.lengthVarInt64(self
.height_
)
848 def ByteSizePartial(self
):
850 if (self
.has_content_
):
852 n
+= self
.lengthString(len(self
.content_
))
853 if (self
.has_blob_key_
): n
+= 1 + self
.lengthString(len(self
.blob_key_
))
854 if (self
.has_width_
): n
+= 1 + self
.lengthVarInt64(self
.width_
)
855 if (self
.has_height_
): n
+= 1 + self
.lengthVarInt64(self
.height_
)
860 self
.clear_blob_key()
864 def OutputUnchecked(self
, out
):
866 out
.putPrefixedString(self
.content_
)
867 if (self
.has_blob_key_
):
869 out
.putPrefixedString(self
.blob_key_
)
870 if (self
.has_width_
):
872 out
.putVarInt32(self
.width_
)
873 if (self
.has_height_
):
875 out
.putVarInt32(self
.height_
)
877 def OutputPartial(self
, out
):
878 if (self
.has_content_
):
880 out
.putPrefixedString(self
.content_
)
881 if (self
.has_blob_key_
):
883 out
.putPrefixedString(self
.blob_key_
)
884 if (self
.has_width_
):
886 out
.putVarInt32(self
.width_
)
887 if (self
.has_height_
):
889 out
.putVarInt32(self
.height_
)
891 def TryMerge(self
, d
):
895 self
.set_content(d
.getPrefixedString())
898 self
.set_blob_key(d
.getPrefixedString())
901 self
.set_width(d
.getVarInt32())
904 self
.set_height(d
.getVarInt32())
908 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
912 def __str__(self
, prefix
="", printElemNumber
=0):
914 if self
.has_content_
: res
+=prefix
+("content: %s\n" % self
.DebugFormatString(self
.content_
))
915 if self
.has_blob_key_
: res
+=prefix
+("blob_key: %s\n" % self
.DebugFormatString(self
.blob_key_
))
916 if self
.has_width_
: res
+=prefix
+("width: %s\n" % self
.DebugFormatInt32(self
.width_
))
917 if self
.has_height_
: res
+=prefix
+("height: %s\n" % self
.DebugFormatInt32(self
.height_
))
921 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
922 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
929 _TEXT
= _BuildTagLookupTable({
937 _TYPES
= _BuildTagLookupTable({
938 0: ProtocolBuffer
.Encoder
.NUMERIC
,
939 1: ProtocolBuffer
.Encoder
.STRING
,
940 2: ProtocolBuffer
.Encoder
.STRING
,
941 3: ProtocolBuffer
.Encoder
.NUMERIC
,
942 4: ProtocolBuffer
.Encoder
.NUMERIC
,
943 }, 4, ProtocolBuffer
.Encoder
.MAX_TYPE
)
947 _STYLE_CONTENT_TYPE
= """"""
948 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImageData'
949 class InputSettings(ProtocolBuffer
.ProtocolMessage
):
952 UNCHANGED_ORIENTATION
= 0
953 CORRECT_ORIENTATION
= 1
955 _ORIENTATION_CORRECTION_TYPE_NAMES
= {
956 0: "UNCHANGED_ORIENTATION",
957 1: "CORRECT_ORIENTATION",
960 def ORIENTATION_CORRECTION_TYPE_Name(cls
, x
): return cls
._ORIENTATION
_CORRECTION
_TYPE
_NAMES
.get(x
, "")
961 ORIENTATION_CORRECTION_TYPE_Name
= classmethod(ORIENTATION_CORRECTION_TYPE_Name
)
963 has_correct_exif_orientation_
= 0
964 correct_exif_orientation_
= 0
965 has_parse_metadata_
= 0
967 has_transparent_substitution_rgb_
= 0
968 transparent_substitution_rgb_
= 0
970 def __init__(self
, contents
=None):
971 if contents
is not None: self
.MergeFromString(contents
)
973 def correct_exif_orientation(self
): return self
.correct_exif_orientation_
975 def set_correct_exif_orientation(self
, x
):
976 self
.has_correct_exif_orientation_
= 1
977 self
.correct_exif_orientation_
= x
979 def clear_correct_exif_orientation(self
):
980 if self
.has_correct_exif_orientation_
:
981 self
.has_correct_exif_orientation_
= 0
982 self
.correct_exif_orientation_
= 0
984 def has_correct_exif_orientation(self
): return self
.has_correct_exif_orientation_
986 def parse_metadata(self
): return self
.parse_metadata_
988 def set_parse_metadata(self
, x
):
989 self
.has_parse_metadata_
= 1
990 self
.parse_metadata_
= x
992 def clear_parse_metadata(self
):
993 if self
.has_parse_metadata_
:
994 self
.has_parse_metadata_
= 0
995 self
.parse_metadata_
= 0
997 def has_parse_metadata(self
): return self
.has_parse_metadata_
999 def transparent_substitution_rgb(self
): return self
.transparent_substitution_rgb_
1001 def set_transparent_substitution_rgb(self
, x
):
1002 self
.has_transparent_substitution_rgb_
= 1
1003 self
.transparent_substitution_rgb_
= x
1005 def clear_transparent_substitution_rgb(self
):
1006 if self
.has_transparent_substitution_rgb_
:
1007 self
.has_transparent_substitution_rgb_
= 0
1008 self
.transparent_substitution_rgb_
= 0
1010 def has_transparent_substitution_rgb(self
): return self
.has_transparent_substitution_rgb_
1013 def MergeFrom(self
, x
):
1014 assert x
is not self
1015 if (x
.has_correct_exif_orientation()): self
.set_correct_exif_orientation(x
.correct_exif_orientation())
1016 if (x
.has_parse_metadata()): self
.set_parse_metadata(x
.parse_metadata())
1017 if (x
.has_transparent_substitution_rgb()): self
.set_transparent_substitution_rgb(x
.transparent_substitution_rgb())
1019 def Equals(self
, x
):
1020 if x
is self
: return 1
1021 if self
.has_correct_exif_orientation_
!= x
.has_correct_exif_orientation_
: return 0
1022 if self
.has_correct_exif_orientation_
and self
.correct_exif_orientation_
!= x
.correct_exif_orientation_
: return 0
1023 if self
.has_parse_metadata_
!= x
.has_parse_metadata_
: return 0
1024 if self
.has_parse_metadata_
and self
.parse_metadata_
!= x
.parse_metadata_
: return 0
1025 if self
.has_transparent_substitution_rgb_
!= x
.has_transparent_substitution_rgb_
: return 0
1026 if self
.has_transparent_substitution_rgb_
and self
.transparent_substitution_rgb_
!= x
.transparent_substitution_rgb_
: return 0
1029 def IsInitialized(self
, debug_strs
=None):
1035 if (self
.has_correct_exif_orientation_
): n
+= 1 + self
.lengthVarInt64(self
.correct_exif_orientation_
)
1036 if (self
.has_parse_metadata_
): n
+= 2
1037 if (self
.has_transparent_substitution_rgb_
): n
+= 1 + self
.lengthVarInt64(self
.transparent_substitution_rgb_
)
1040 def ByteSizePartial(self
):
1042 if (self
.has_correct_exif_orientation_
): n
+= 1 + self
.lengthVarInt64(self
.correct_exif_orientation_
)
1043 if (self
.has_parse_metadata_
): n
+= 2
1044 if (self
.has_transparent_substitution_rgb_
): n
+= 1 + self
.lengthVarInt64(self
.transparent_substitution_rgb_
)
1048 self
.clear_correct_exif_orientation()
1049 self
.clear_parse_metadata()
1050 self
.clear_transparent_substitution_rgb()
1052 def OutputUnchecked(self
, out
):
1053 if (self
.has_correct_exif_orientation_
):
1055 out
.putVarInt32(self
.correct_exif_orientation_
)
1056 if (self
.has_parse_metadata_
):
1058 out
.putBoolean(self
.parse_metadata_
)
1059 if (self
.has_transparent_substitution_rgb_
):
1061 out
.putVarInt32(self
.transparent_substitution_rgb_
)
1063 def OutputPartial(self
, out
):
1064 if (self
.has_correct_exif_orientation_
):
1066 out
.putVarInt32(self
.correct_exif_orientation_
)
1067 if (self
.has_parse_metadata_
):
1069 out
.putBoolean(self
.parse_metadata_
)
1070 if (self
.has_transparent_substitution_rgb_
):
1072 out
.putVarInt32(self
.transparent_substitution_rgb_
)
1074 def TryMerge(self
, d
):
1075 while d
.avail() > 0:
1076 tt
= d
.getVarInt32()
1078 self
.set_correct_exif_orientation(d
.getVarInt32())
1081 self
.set_parse_metadata(d
.getBoolean())
1084 self
.set_transparent_substitution_rgb(d
.getVarInt32())
1088 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1092 def __str__(self
, prefix
="", printElemNumber
=0):
1094 if self
.has_correct_exif_orientation_
: res
+=prefix
+("correct_exif_orientation: %s\n" % self
.DebugFormatInt32(self
.correct_exif_orientation_
))
1095 if self
.has_parse_metadata_
: res
+=prefix
+("parse_metadata: %s\n" % self
.DebugFormatBool(self
.parse_metadata_
))
1096 if self
.has_transparent_substitution_rgb_
: res
+=prefix
+("transparent_substitution_rgb: %s\n" % self
.DebugFormatInt32(self
.transparent_substitution_rgb_
))
1100 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1101 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1103 kcorrect_exif_orientation
= 1
1105 ktransparent_substitution_rgb
= 3
1107 _TEXT
= _BuildTagLookupTable({
1109 1: "correct_exif_orientation",
1110 2: "parse_metadata",
1111 3: "transparent_substitution_rgb",
1114 _TYPES
= _BuildTagLookupTable({
1115 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1116 1: ProtocolBuffer
.Encoder
.NUMERIC
,
1117 2: ProtocolBuffer
.Encoder
.NUMERIC
,
1118 3: ProtocolBuffer
.Encoder
.NUMERIC
,
1119 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1123 _STYLE_CONTENT_TYPE
= """"""
1124 _PROTO_DESCRIPTOR_NAME
= 'apphosting.InputSettings'
1125 class OutputSettings(ProtocolBuffer
.ProtocolMessage
):
1132 _MIME_TYPE_NAMES
= {
1138 def MIME_TYPE_Name(cls
, x
): return cls
._MIME
_TYPE
_NAMES
.get(x
, "")
1139 MIME_TYPE_Name
= classmethod(MIME_TYPE_Name
)
1146 def __init__(self
, contents
=None):
1147 if contents
is not None: self
.MergeFromString(contents
)
1149 def mime_type(self
): return self
.mime_type_
1151 def set_mime_type(self
, x
):
1152 self
.has_mime_type_
= 1
1155 def clear_mime_type(self
):
1156 if self
.has_mime_type_
:
1157 self
.has_mime_type_
= 0
1160 def has_mime_type(self
): return self
.has_mime_type_
1162 def quality(self
): return self
.quality_
1164 def set_quality(self
, x
):
1165 self
.has_quality_
= 1
1168 def clear_quality(self
):
1169 if self
.has_quality_
:
1170 self
.has_quality_
= 0
1173 def has_quality(self
): return self
.has_quality_
1176 def MergeFrom(self
, x
):
1177 assert x
is not self
1178 if (x
.has_mime_type()): self
.set_mime_type(x
.mime_type())
1179 if (x
.has_quality()): self
.set_quality(x
.quality())
1181 def Equals(self
, x
):
1182 if x
is self
: return 1
1183 if self
.has_mime_type_
!= x
.has_mime_type_
: return 0
1184 if self
.has_mime_type_
and self
.mime_type_
!= x
.mime_type_
: return 0
1185 if self
.has_quality_
!= x
.has_quality_
: return 0
1186 if self
.has_quality_
and self
.quality_
!= x
.quality_
: return 0
1189 def IsInitialized(self
, debug_strs
=None):
1195 if (self
.has_mime_type_
): n
+= 1 + self
.lengthVarInt64(self
.mime_type_
)
1196 if (self
.has_quality_
): n
+= 1 + self
.lengthVarInt64(self
.quality_
)
1199 def ByteSizePartial(self
):
1201 if (self
.has_mime_type_
): n
+= 1 + self
.lengthVarInt64(self
.mime_type_
)
1202 if (self
.has_quality_
): n
+= 1 + self
.lengthVarInt64(self
.quality_
)
1206 self
.clear_mime_type()
1207 self
.clear_quality()
1209 def OutputUnchecked(self
, out
):
1210 if (self
.has_mime_type_
):
1212 out
.putVarInt32(self
.mime_type_
)
1213 if (self
.has_quality_
):
1215 out
.putVarInt32(self
.quality_
)
1217 def OutputPartial(self
, out
):
1218 if (self
.has_mime_type_
):
1220 out
.putVarInt32(self
.mime_type_
)
1221 if (self
.has_quality_
):
1223 out
.putVarInt32(self
.quality_
)
1225 def TryMerge(self
, d
):
1226 while d
.avail() > 0:
1227 tt
= d
.getVarInt32()
1229 self
.set_mime_type(d
.getVarInt32())
1232 self
.set_quality(d
.getVarInt32())
1236 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1240 def __str__(self
, prefix
="", printElemNumber
=0):
1242 if self
.has_mime_type_
: res
+=prefix
+("mime_type: %s\n" % self
.DebugFormatInt32(self
.mime_type_
))
1243 if self
.has_quality_
: res
+=prefix
+("quality: %s\n" % self
.DebugFormatInt32(self
.quality_
))
1247 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1248 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1253 _TEXT
= _BuildTagLookupTable({
1259 _TYPES
= _BuildTagLookupTable({
1260 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1261 1: ProtocolBuffer
.Encoder
.NUMERIC
,
1262 2: ProtocolBuffer
.Encoder
.NUMERIC
,
1263 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1267 _STYLE_CONTENT_TYPE
= """"""
1268 _PROTO_DESCRIPTOR_NAME
= 'apphosting.OutputSettings'
1269 class ImagesTransformRequest(ProtocolBuffer
.ProtocolMessage
):
1275 def __init__(self
, contents
=None):
1276 self
.image_
= ImageData()
1277 self
.transform_
= []
1278 self
.output_
= OutputSettings()
1279 self
.lazy_init_lock_
= thread
.allocate_lock()
1280 if contents
is not None: self
.MergeFromString(contents
)
1282 def image(self
): return self
.image_
1284 def mutable_image(self
): self
.has_image_
= 1; return self
.image_
1286 def clear_image(self
):self
.has_image_
= 0; self
.image_
.Clear()
1288 def has_image(self
): return self
.has_image_
1290 def transform_size(self
): return len(self
.transform_
)
1291 def transform_list(self
): return self
.transform_
1293 def transform(self
, i
):
1294 return self
.transform_
[i
]
1296 def mutable_transform(self
, i
):
1297 return self
.transform_
[i
]
1299 def add_transform(self
):
1301 self
.transform_
.append(x
)
1304 def clear_transform(self
):
1305 self
.transform_
= []
1306 def output(self
): return self
.output_
1308 def mutable_output(self
): self
.has_output_
= 1; return self
.output_
1310 def clear_output(self
):self
.has_output_
= 0; self
.output_
.Clear()
1312 def has_output(self
): return self
.has_output_
1315 if self
.input_
is None:
1316 self
.lazy_init_lock_
.acquire()
1318 if self
.input_
is None: self
.input_
= InputSettings()
1320 self
.lazy_init_lock_
.release()
1323 def mutable_input(self
): self
.has_input_
= 1; return self
.input()
1325 def clear_input(self
):
1328 self
.has_input_
= 0;
1329 if self
.input_
is not None: self
.input_
.Clear()
1331 def has_input(self
): return self
.has_input_
1334 def MergeFrom(self
, x
):
1335 assert x
is not self
1336 if (x
.has_image()): self
.mutable_image().MergeFrom(x
.image())
1337 for i
in xrange(x
.transform_size()): self
.add_transform().CopyFrom(x
.transform(i
))
1338 if (x
.has_output()): self
.mutable_output().MergeFrom(x
.output())
1339 if (x
.has_input()): self
.mutable_input().MergeFrom(x
.input())
1341 def Equals(self
, x
):
1342 if x
is self
: return 1
1343 if self
.has_image_
!= x
.has_image_
: return 0
1344 if self
.has_image_
and self
.image_
!= x
.image_
: return 0
1345 if len(self
.transform_
) != len(x
.transform_
): return 0
1346 for e1
, e2
in zip(self
.transform_
, x
.transform_
):
1347 if e1
!= e2
: return 0
1348 if self
.has_output_
!= x
.has_output_
: return 0
1349 if self
.has_output_
and self
.output_
!= x
.output_
: return 0
1350 if self
.has_input_
!= x
.has_input_
: return 0
1351 if self
.has_input_
and self
.input_
!= x
.input_
: return 0
1354 def IsInitialized(self
, debug_strs
=None):
1356 if (not self
.has_image_
):
1358 if debug_strs
is not None:
1359 debug_strs
.append('Required field: image not set.')
1360 elif not self
.image_
.IsInitialized(debug_strs
): initialized
= 0
1361 for p
in self
.transform_
:
1362 if not p
.IsInitialized(debug_strs
): initialized
=0
1363 if (not self
.has_output_
):
1365 if debug_strs
is not None:
1366 debug_strs
.append('Required field: output not set.')
1367 elif not self
.output_
.IsInitialized(debug_strs
): initialized
= 0
1368 if (self
.has_input_
and not self
.input_
.IsInitialized(debug_strs
)): initialized
= 0
1373 n
+= self
.lengthString(self
.image_
.ByteSize())
1374 n
+= 1 * len(self
.transform_
)
1375 for i
in xrange(len(self
.transform_
)): n
+= self
.lengthString(self
.transform_
[i
].ByteSize())
1376 n
+= self
.lengthString(self
.output_
.ByteSize())
1377 if (self
.has_input_
): n
+= 1 + self
.lengthString(self
.input_
.ByteSize())
1380 def ByteSizePartial(self
):
1382 if (self
.has_image_
):
1384 n
+= self
.lengthString(self
.image_
.ByteSizePartial())
1385 n
+= 1 * len(self
.transform_
)
1386 for i
in xrange(len(self
.transform_
)): n
+= self
.lengthString(self
.transform_
[i
].ByteSizePartial())
1387 if (self
.has_output_
):
1389 n
+= self
.lengthString(self
.output_
.ByteSizePartial())
1390 if (self
.has_input_
): n
+= 1 + self
.lengthString(self
.input_
.ByteSizePartial())
1395 self
.clear_transform()
1399 def OutputUnchecked(self
, out
):
1401 out
.putVarInt32(self
.image_
.ByteSize())
1402 self
.image_
.OutputUnchecked(out
)
1403 for i
in xrange(len(self
.transform_
)):
1405 out
.putVarInt32(self
.transform_
[i
].ByteSize())
1406 self
.transform_
[i
].OutputUnchecked(out
)
1408 out
.putVarInt32(self
.output_
.ByteSize())
1409 self
.output_
.OutputUnchecked(out
)
1410 if (self
.has_input_
):
1412 out
.putVarInt32(self
.input_
.ByteSize())
1413 self
.input_
.OutputUnchecked(out
)
1415 def OutputPartial(self
, out
):
1416 if (self
.has_image_
):
1418 out
.putVarInt32(self
.image_
.ByteSizePartial())
1419 self
.image_
.OutputPartial(out
)
1420 for i
in xrange(len(self
.transform_
)):
1422 out
.putVarInt32(self
.transform_
[i
].ByteSizePartial())
1423 self
.transform_
[i
].OutputPartial(out
)
1424 if (self
.has_output_
):
1426 out
.putVarInt32(self
.output_
.ByteSizePartial())
1427 self
.output_
.OutputPartial(out
)
1428 if (self
.has_input_
):
1430 out
.putVarInt32(self
.input_
.ByteSizePartial())
1431 self
.input_
.OutputPartial(out
)
1433 def TryMerge(self
, d
):
1434 while d
.avail() > 0:
1435 tt
= d
.getVarInt32()
1437 length
= d
.getVarInt32()
1438 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1440 self
.mutable_image().TryMerge(tmp
)
1443 length
= d
.getVarInt32()
1444 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1446 self
.add_transform().TryMerge(tmp
)
1449 length
= d
.getVarInt32()
1450 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1452 self
.mutable_output().TryMerge(tmp
)
1455 length
= d
.getVarInt32()
1456 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1458 self
.mutable_input().TryMerge(tmp
)
1462 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1466 def __str__(self
, prefix
="", printElemNumber
=0):
1469 res
+=prefix
+"image <\n"
1470 res
+=self
.image_
.__str
__(prefix
+ " ", printElemNumber
)
1473 for e
in self
.transform_
:
1475 if printElemNumber
: elm
="(%d)" % cnt
1476 res
+=prefix
+("transform%s <\n" % elm
)
1477 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
1480 if self
.has_output_
:
1481 res
+=prefix
+"output <\n"
1482 res
+=self
.output_
.__str
__(prefix
+ " ", printElemNumber
)
1485 res
+=prefix
+"input <\n"
1486 res
+=self
.input_
.__str
__(prefix
+ " ", printElemNumber
)
1491 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1492 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1499 _TEXT
= _BuildTagLookupTable({
1507 _TYPES
= _BuildTagLookupTable({
1508 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1509 1: ProtocolBuffer
.Encoder
.STRING
,
1510 2: ProtocolBuffer
.Encoder
.STRING
,
1511 3: ProtocolBuffer
.Encoder
.STRING
,
1512 4: ProtocolBuffer
.Encoder
.STRING
,
1513 }, 4, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1517 _STYLE_CONTENT_TYPE
= """"""
1518 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImagesTransformRequest'
1519 class ImagesTransformResponse(ProtocolBuffer
.ProtocolMessage
):
1521 has_source_metadata_
= 0
1522 source_metadata_
= ""
1524 def __init__(self
, contents
=None):
1525 self
.image_
= ImageData()
1526 if contents
is not None: self
.MergeFromString(contents
)
1528 def image(self
): return self
.image_
1530 def mutable_image(self
): self
.has_image_
= 1; return self
.image_
1532 def clear_image(self
):self
.has_image_
= 0; self
.image_
.Clear()
1534 def has_image(self
): return self
.has_image_
1536 def source_metadata(self
): return self
.source_metadata_
1538 def set_source_metadata(self
, x
):
1539 self
.has_source_metadata_
= 1
1540 self
.source_metadata_
= x
1542 def clear_source_metadata(self
):
1543 if self
.has_source_metadata_
:
1544 self
.has_source_metadata_
= 0
1545 self
.source_metadata_
= ""
1547 def has_source_metadata(self
): return self
.has_source_metadata_
1550 def MergeFrom(self
, x
):
1551 assert x
is not self
1552 if (x
.has_image()): self
.mutable_image().MergeFrom(x
.image())
1553 if (x
.has_source_metadata()): self
.set_source_metadata(x
.source_metadata())
1555 def Equals(self
, x
):
1556 if x
is self
: return 1
1557 if self
.has_image_
!= x
.has_image_
: return 0
1558 if self
.has_image_
and self
.image_
!= x
.image_
: return 0
1559 if self
.has_source_metadata_
!= x
.has_source_metadata_
: return 0
1560 if self
.has_source_metadata_
and self
.source_metadata_
!= x
.source_metadata_
: return 0
1563 def IsInitialized(self
, debug_strs
=None):
1565 if (not self
.has_image_
):
1567 if debug_strs
is not None:
1568 debug_strs
.append('Required field: image not set.')
1569 elif not self
.image_
.IsInitialized(debug_strs
): initialized
= 0
1574 n
+= self
.lengthString(self
.image_
.ByteSize())
1575 if (self
.has_source_metadata_
): n
+= 1 + self
.lengthString(len(self
.source_metadata_
))
1578 def ByteSizePartial(self
):
1580 if (self
.has_image_
):
1582 n
+= self
.lengthString(self
.image_
.ByteSizePartial())
1583 if (self
.has_source_metadata_
): n
+= 1 + self
.lengthString(len(self
.source_metadata_
))
1588 self
.clear_source_metadata()
1590 def OutputUnchecked(self
, out
):
1592 out
.putVarInt32(self
.image_
.ByteSize())
1593 self
.image_
.OutputUnchecked(out
)
1594 if (self
.has_source_metadata_
):
1596 out
.putPrefixedString(self
.source_metadata_
)
1598 def OutputPartial(self
, out
):
1599 if (self
.has_image_
):
1601 out
.putVarInt32(self
.image_
.ByteSizePartial())
1602 self
.image_
.OutputPartial(out
)
1603 if (self
.has_source_metadata_
):
1605 out
.putPrefixedString(self
.source_metadata_
)
1607 def TryMerge(self
, d
):
1608 while d
.avail() > 0:
1609 tt
= d
.getVarInt32()
1611 length
= d
.getVarInt32()
1612 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1614 self
.mutable_image().TryMerge(tmp
)
1617 self
.set_source_metadata(d
.getPrefixedString())
1621 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1625 def __str__(self
, prefix
="", printElemNumber
=0):
1628 res
+=prefix
+"image <\n"
1629 res
+=self
.image_
.__str
__(prefix
+ " ", printElemNumber
)
1631 if self
.has_source_metadata_
: res
+=prefix
+("source_metadata: %s\n" % self
.DebugFormatString(self
.source_metadata_
))
1635 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1636 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1639 ksource_metadata
= 2
1641 _TEXT
= _BuildTagLookupTable({
1644 2: "source_metadata",
1647 _TYPES
= _BuildTagLookupTable({
1648 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1649 1: ProtocolBuffer
.Encoder
.STRING
,
1650 2: ProtocolBuffer
.Encoder
.STRING
,
1651 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1655 _STYLE_CONTENT_TYPE
= """"""
1656 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImagesTransformResponse'
1657 class CompositeImageOptions(ProtocolBuffer
.ProtocolMessage
):
1682 def ANCHOR_Name(cls
, x
): return cls
._ANCHOR
_NAMES
.get(x
, "")
1683 ANCHOR_Name
= classmethod(ANCHOR_Name
)
1685 has_source_index_
= 0
1696 def __init__(self
, contents
=None):
1697 if contents
is not None: self
.MergeFromString(contents
)
1699 def source_index(self
): return self
.source_index_
1701 def set_source_index(self
, x
):
1702 self
.has_source_index_
= 1
1703 self
.source_index_
= x
1705 def clear_source_index(self
):
1706 if self
.has_source_index_
:
1707 self
.has_source_index_
= 0
1708 self
.source_index_
= 0
1710 def has_source_index(self
): return self
.has_source_index_
1712 def x_offset(self
): return self
.x_offset_
1714 def set_x_offset(self
, x
):
1715 self
.has_x_offset_
= 1
1718 def clear_x_offset(self
):
1719 if self
.has_x_offset_
:
1720 self
.has_x_offset_
= 0
1723 def has_x_offset(self
): return self
.has_x_offset_
1725 def y_offset(self
): return self
.y_offset_
1727 def set_y_offset(self
, x
):
1728 self
.has_y_offset_
= 1
1731 def clear_y_offset(self
):
1732 if self
.has_y_offset_
:
1733 self
.has_y_offset_
= 0
1736 def has_y_offset(self
): return self
.has_y_offset_
1738 def opacity(self
): return self
.opacity_
1740 def set_opacity(self
, x
):
1741 self
.has_opacity_
= 1
1744 def clear_opacity(self
):
1745 if self
.has_opacity_
:
1746 self
.has_opacity_
= 0
1749 def has_opacity(self
): return self
.has_opacity_
1751 def anchor(self
): return self
.anchor_
1753 def set_anchor(self
, x
):
1754 self
.has_anchor_
= 1
1757 def clear_anchor(self
):
1758 if self
.has_anchor_
:
1759 self
.has_anchor_
= 0
1762 def has_anchor(self
): return self
.has_anchor_
1765 def MergeFrom(self
, x
):
1766 assert x
is not self
1767 if (x
.has_source_index()): self
.set_source_index(x
.source_index())
1768 if (x
.has_x_offset()): self
.set_x_offset(x
.x_offset())
1769 if (x
.has_y_offset()): self
.set_y_offset(x
.y_offset())
1770 if (x
.has_opacity()): self
.set_opacity(x
.opacity())
1771 if (x
.has_anchor()): self
.set_anchor(x
.anchor())
1773 def Equals(self
, x
):
1774 if x
is self
: return 1
1775 if self
.has_source_index_
!= x
.has_source_index_
: return 0
1776 if self
.has_source_index_
and self
.source_index_
!= x
.source_index_
: return 0
1777 if self
.has_x_offset_
!= x
.has_x_offset_
: return 0
1778 if self
.has_x_offset_
and self
.x_offset_
!= x
.x_offset_
: return 0
1779 if self
.has_y_offset_
!= x
.has_y_offset_
: return 0
1780 if self
.has_y_offset_
and self
.y_offset_
!= x
.y_offset_
: return 0
1781 if self
.has_opacity_
!= x
.has_opacity_
: return 0
1782 if self
.has_opacity_
and self
.opacity_
!= x
.opacity_
: return 0
1783 if self
.has_anchor_
!= x
.has_anchor_
: return 0
1784 if self
.has_anchor_
and self
.anchor_
!= x
.anchor_
: return 0
1787 def IsInitialized(self
, debug_strs
=None):
1789 if (not self
.has_source_index_
):
1791 if debug_strs
is not None:
1792 debug_strs
.append('Required field: source_index not set.')
1793 if (not self
.has_x_offset_
):
1795 if debug_strs
is not None:
1796 debug_strs
.append('Required field: x_offset not set.')
1797 if (not self
.has_y_offset_
):
1799 if debug_strs
is not None:
1800 debug_strs
.append('Required field: y_offset not set.')
1801 if (not self
.has_opacity_
):
1803 if debug_strs
is not None:
1804 debug_strs
.append('Required field: opacity not set.')
1805 if (not self
.has_anchor_
):
1807 if debug_strs
is not None:
1808 debug_strs
.append('Required field: anchor not set.')
1813 n
+= self
.lengthVarInt64(self
.source_index_
)
1814 n
+= self
.lengthVarInt64(self
.x_offset_
)
1815 n
+= self
.lengthVarInt64(self
.y_offset_
)
1816 n
+= self
.lengthVarInt64(self
.anchor_
)
1819 def ByteSizePartial(self
):
1821 if (self
.has_source_index_
):
1823 n
+= self
.lengthVarInt64(self
.source_index_
)
1824 if (self
.has_x_offset_
):
1826 n
+= self
.lengthVarInt64(self
.x_offset_
)
1827 if (self
.has_y_offset_
):
1829 n
+= self
.lengthVarInt64(self
.y_offset_
)
1830 if (self
.has_opacity_
):
1832 if (self
.has_anchor_
):
1834 n
+= self
.lengthVarInt64(self
.anchor_
)
1838 self
.clear_source_index()
1839 self
.clear_x_offset()
1840 self
.clear_y_offset()
1841 self
.clear_opacity()
1844 def OutputUnchecked(self
, out
):
1846 out
.putVarInt32(self
.source_index_
)
1848 out
.putVarInt32(self
.x_offset_
)
1850 out
.putVarInt32(self
.y_offset_
)
1852 out
.putFloat(self
.opacity_
)
1854 out
.putVarInt32(self
.anchor_
)
1856 def OutputPartial(self
, out
):
1857 if (self
.has_source_index_
):
1859 out
.putVarInt32(self
.source_index_
)
1860 if (self
.has_x_offset_
):
1862 out
.putVarInt32(self
.x_offset_
)
1863 if (self
.has_y_offset_
):
1865 out
.putVarInt32(self
.y_offset_
)
1866 if (self
.has_opacity_
):
1868 out
.putFloat(self
.opacity_
)
1869 if (self
.has_anchor_
):
1871 out
.putVarInt32(self
.anchor_
)
1873 def TryMerge(self
, d
):
1874 while d
.avail() > 0:
1875 tt
= d
.getVarInt32()
1877 self
.set_source_index(d
.getVarInt32())
1880 self
.set_x_offset(d
.getVarInt32())
1883 self
.set_y_offset(d
.getVarInt32())
1886 self
.set_opacity(d
.getFloat())
1889 self
.set_anchor(d
.getVarInt32())
1893 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1897 def __str__(self
, prefix
="", printElemNumber
=0):
1899 if self
.has_source_index_
: res
+=prefix
+("source_index: %s\n" % self
.DebugFormatInt32(self
.source_index_
))
1900 if self
.has_x_offset_
: res
+=prefix
+("x_offset: %s\n" % self
.DebugFormatInt32(self
.x_offset_
))
1901 if self
.has_y_offset_
: res
+=prefix
+("y_offset: %s\n" % self
.DebugFormatInt32(self
.y_offset_
))
1902 if self
.has_opacity_
: res
+=prefix
+("opacity: %s\n" % self
.DebugFormatFloat(self
.opacity_
))
1903 if self
.has_anchor_
: res
+=prefix
+("anchor: %s\n" % self
.DebugFormatInt32(self
.anchor_
))
1907 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1908 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1916 _TEXT
= _BuildTagLookupTable({
1925 _TYPES
= _BuildTagLookupTable({
1926 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1927 1: ProtocolBuffer
.Encoder
.NUMERIC
,
1928 2: ProtocolBuffer
.Encoder
.NUMERIC
,
1929 3: ProtocolBuffer
.Encoder
.NUMERIC
,
1930 4: ProtocolBuffer
.Encoder
.FLOAT
,
1931 5: ProtocolBuffer
.Encoder
.NUMERIC
,
1932 }, 5, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1936 _STYLE_CONTENT_TYPE
= """"""
1937 _PROTO_DESCRIPTOR_NAME
= 'apphosting.CompositeImageOptions'
1938 class ImagesCanvas(ProtocolBuffer
.ProtocolMessage
):
1947 def __init__(self
, contents
=None):
1948 self
.output_
= OutputSettings()
1949 if contents
is not None: self
.MergeFromString(contents
)
1951 def width(self
): return self
.width_
1953 def set_width(self
, x
):
1957 def clear_width(self
):
1962 def has_width(self
): return self
.has_width_
1964 def height(self
): return self
.height_
1966 def set_height(self
, x
):
1967 self
.has_height_
= 1
1970 def clear_height(self
):
1971 if self
.has_height_
:
1972 self
.has_height_
= 0
1975 def has_height(self
): return self
.has_height_
1977 def output(self
): return self
.output_
1979 def mutable_output(self
): self
.has_output_
= 1; return self
.output_
1981 def clear_output(self
):self
.has_output_
= 0; self
.output_
.Clear()
1983 def has_output(self
): return self
.has_output_
1985 def color(self
): return self
.color_
1987 def set_color(self
, x
):
1991 def clear_color(self
):
1996 def has_color(self
): return self
.has_color_
1999 def MergeFrom(self
, x
):
2000 assert x
is not self
2001 if (x
.has_width()): self
.set_width(x
.width())
2002 if (x
.has_height()): self
.set_height(x
.height())
2003 if (x
.has_output()): self
.mutable_output().MergeFrom(x
.output())
2004 if (x
.has_color()): self
.set_color(x
.color())
2006 def Equals(self
, x
):
2007 if x
is self
: return 1
2008 if self
.has_width_
!= x
.has_width_
: return 0
2009 if self
.has_width_
and self
.width_
!= x
.width_
: return 0
2010 if self
.has_height_
!= x
.has_height_
: return 0
2011 if self
.has_height_
and self
.height_
!= x
.height_
: return 0
2012 if self
.has_output_
!= x
.has_output_
: return 0
2013 if self
.has_output_
and self
.output_
!= x
.output_
: return 0
2014 if self
.has_color_
!= x
.has_color_
: return 0
2015 if self
.has_color_
and self
.color_
!= x
.color_
: return 0
2018 def IsInitialized(self
, debug_strs
=None):
2020 if (not self
.has_width_
):
2022 if debug_strs
is not None:
2023 debug_strs
.append('Required field: width not set.')
2024 if (not self
.has_height_
):
2026 if debug_strs
is not None:
2027 debug_strs
.append('Required field: height not set.')
2028 if (not self
.has_output_
):
2030 if debug_strs
is not None:
2031 debug_strs
.append('Required field: output not set.')
2032 elif not self
.output_
.IsInitialized(debug_strs
): initialized
= 0
2037 n
+= self
.lengthVarInt64(self
.width_
)
2038 n
+= self
.lengthVarInt64(self
.height_
)
2039 n
+= self
.lengthString(self
.output_
.ByteSize())
2040 if (self
.has_color_
): n
+= 1 + self
.lengthVarInt64(self
.color_
)
2043 def ByteSizePartial(self
):
2045 if (self
.has_width_
):
2047 n
+= self
.lengthVarInt64(self
.width_
)
2048 if (self
.has_height_
):
2050 n
+= self
.lengthVarInt64(self
.height_
)
2051 if (self
.has_output_
):
2053 n
+= self
.lengthString(self
.output_
.ByteSizePartial())
2054 if (self
.has_color_
): n
+= 1 + self
.lengthVarInt64(self
.color_
)
2063 def OutputUnchecked(self
, out
):
2065 out
.putVarInt32(self
.width_
)
2067 out
.putVarInt32(self
.height_
)
2069 out
.putVarInt32(self
.output_
.ByteSize())
2070 self
.output_
.OutputUnchecked(out
)
2071 if (self
.has_color_
):
2073 out
.putVarInt32(self
.color_
)
2075 def OutputPartial(self
, out
):
2076 if (self
.has_width_
):
2078 out
.putVarInt32(self
.width_
)
2079 if (self
.has_height_
):
2081 out
.putVarInt32(self
.height_
)
2082 if (self
.has_output_
):
2084 out
.putVarInt32(self
.output_
.ByteSizePartial())
2085 self
.output_
.OutputPartial(out
)
2086 if (self
.has_color_
):
2088 out
.putVarInt32(self
.color_
)
2090 def TryMerge(self
, d
):
2091 while d
.avail() > 0:
2092 tt
= d
.getVarInt32()
2094 self
.set_width(d
.getVarInt32())
2097 self
.set_height(d
.getVarInt32())
2100 length
= d
.getVarInt32()
2101 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2103 self
.mutable_output().TryMerge(tmp
)
2106 self
.set_color(d
.getVarInt32())
2110 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2114 def __str__(self
, prefix
="", printElemNumber
=0):
2116 if self
.has_width_
: res
+=prefix
+("width: %s\n" % self
.DebugFormatInt32(self
.width_
))
2117 if self
.has_height_
: res
+=prefix
+("height: %s\n" % self
.DebugFormatInt32(self
.height_
))
2118 if self
.has_output_
:
2119 res
+=prefix
+"output <\n"
2120 res
+=self
.output_
.__str
__(prefix
+ " ", printElemNumber
)
2122 if self
.has_color_
: res
+=prefix
+("color: %s\n" % self
.DebugFormatInt32(self
.color_
))
2126 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2127 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2134 _TEXT
= _BuildTagLookupTable({
2142 _TYPES
= _BuildTagLookupTable({
2143 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2144 1: ProtocolBuffer
.Encoder
.NUMERIC
,
2145 2: ProtocolBuffer
.Encoder
.NUMERIC
,
2146 3: ProtocolBuffer
.Encoder
.STRING
,
2147 4: ProtocolBuffer
.Encoder
.NUMERIC
,
2148 }, 4, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2152 _STYLE_CONTENT_TYPE
= """"""
2153 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImagesCanvas'
2154 class ImagesCompositeRequest(ProtocolBuffer
.ProtocolMessage
):
2157 def __init__(self
, contents
=None):
2160 self
.canvas_
= ImagesCanvas()
2161 if contents
is not None: self
.MergeFromString(contents
)
2163 def image_size(self
): return len(self
.image_
)
2164 def image_list(self
): return self
.image_
2167 return self
.image_
[i
]
2169 def mutable_image(self
, i
):
2170 return self
.image_
[i
]
2172 def add_image(self
):
2174 self
.image_
.append(x
)
2177 def clear_image(self
):
2179 def options_size(self
): return len(self
.options_
)
2180 def options_list(self
): return self
.options_
2182 def options(self
, i
):
2183 return self
.options_
[i
]
2185 def mutable_options(self
, i
):
2186 return self
.options_
[i
]
2188 def add_options(self
):
2189 x
= CompositeImageOptions()
2190 self
.options_
.append(x
)
2193 def clear_options(self
):
2195 def canvas(self
): return self
.canvas_
2197 def mutable_canvas(self
): self
.has_canvas_
= 1; return self
.canvas_
2199 def clear_canvas(self
):self
.has_canvas_
= 0; self
.canvas_
.Clear()
2201 def has_canvas(self
): return self
.has_canvas_
2204 def MergeFrom(self
, x
):
2205 assert x
is not self
2206 for i
in xrange(x
.image_size()): self
.add_image().CopyFrom(x
.image(i
))
2207 for i
in xrange(x
.options_size()): self
.add_options().CopyFrom(x
.options(i
))
2208 if (x
.has_canvas()): self
.mutable_canvas().MergeFrom(x
.canvas())
2210 def Equals(self
, x
):
2211 if x
is self
: return 1
2212 if len(self
.image_
) != len(x
.image_
): return 0
2213 for e1
, e2
in zip(self
.image_
, x
.image_
):
2214 if e1
!= e2
: return 0
2215 if len(self
.options_
) != len(x
.options_
): return 0
2216 for e1
, e2
in zip(self
.options_
, x
.options_
):
2217 if e1
!= e2
: return 0
2218 if self
.has_canvas_
!= x
.has_canvas_
: return 0
2219 if self
.has_canvas_
and self
.canvas_
!= x
.canvas_
: return 0
2222 def IsInitialized(self
, debug_strs
=None):
2224 for p
in self
.image_
:
2225 if not p
.IsInitialized(debug_strs
): initialized
=0
2226 for p
in self
.options_
:
2227 if not p
.IsInitialized(debug_strs
): initialized
=0
2228 if (not self
.has_canvas_
):
2230 if debug_strs
is not None:
2231 debug_strs
.append('Required field: canvas not set.')
2232 elif not self
.canvas_
.IsInitialized(debug_strs
): initialized
= 0
2237 n
+= 1 * len(self
.image_
)
2238 for i
in xrange(len(self
.image_
)): n
+= self
.lengthString(self
.image_
[i
].ByteSize())
2239 n
+= 1 * len(self
.options_
)
2240 for i
in xrange(len(self
.options_
)): n
+= self
.lengthString(self
.options_
[i
].ByteSize())
2241 n
+= self
.lengthString(self
.canvas_
.ByteSize())
2244 def ByteSizePartial(self
):
2246 n
+= 1 * len(self
.image_
)
2247 for i
in xrange(len(self
.image_
)): n
+= self
.lengthString(self
.image_
[i
].ByteSizePartial())
2248 n
+= 1 * len(self
.options_
)
2249 for i
in xrange(len(self
.options_
)): n
+= self
.lengthString(self
.options_
[i
].ByteSizePartial())
2250 if (self
.has_canvas_
):
2252 n
+= self
.lengthString(self
.canvas_
.ByteSizePartial())
2257 self
.clear_options()
2260 def OutputUnchecked(self
, out
):
2261 for i
in xrange(len(self
.image_
)):
2263 out
.putVarInt32(self
.image_
[i
].ByteSize())
2264 self
.image_
[i
].OutputUnchecked(out
)
2265 for i
in xrange(len(self
.options_
)):
2267 out
.putVarInt32(self
.options_
[i
].ByteSize())
2268 self
.options_
[i
].OutputUnchecked(out
)
2270 out
.putVarInt32(self
.canvas_
.ByteSize())
2271 self
.canvas_
.OutputUnchecked(out
)
2273 def OutputPartial(self
, out
):
2274 for i
in xrange(len(self
.image_
)):
2276 out
.putVarInt32(self
.image_
[i
].ByteSizePartial())
2277 self
.image_
[i
].OutputPartial(out
)
2278 for i
in xrange(len(self
.options_
)):
2280 out
.putVarInt32(self
.options_
[i
].ByteSizePartial())
2281 self
.options_
[i
].OutputPartial(out
)
2282 if (self
.has_canvas_
):
2284 out
.putVarInt32(self
.canvas_
.ByteSizePartial())
2285 self
.canvas_
.OutputPartial(out
)
2287 def TryMerge(self
, d
):
2288 while d
.avail() > 0:
2289 tt
= d
.getVarInt32()
2291 length
= d
.getVarInt32()
2292 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2294 self
.add_image().TryMerge(tmp
)
2297 length
= d
.getVarInt32()
2298 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2300 self
.add_options().TryMerge(tmp
)
2303 length
= d
.getVarInt32()
2304 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2306 self
.mutable_canvas().TryMerge(tmp
)
2310 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2314 def __str__(self
, prefix
="", printElemNumber
=0):
2317 for e
in self
.image_
:
2319 if printElemNumber
: elm
="(%d)" % cnt
2320 res
+=prefix
+("image%s <\n" % elm
)
2321 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2325 for e
in self
.options_
:
2327 if printElemNumber
: elm
="(%d)" % cnt
2328 res
+=prefix
+("options%s <\n" % elm
)
2329 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2332 if self
.has_canvas_
:
2333 res
+=prefix
+"canvas <\n"
2334 res
+=self
.canvas_
.__str
__(prefix
+ " ", printElemNumber
)
2339 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2340 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2346 _TEXT
= _BuildTagLookupTable({
2353 _TYPES
= _BuildTagLookupTable({
2354 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2355 1: ProtocolBuffer
.Encoder
.STRING
,
2356 2: ProtocolBuffer
.Encoder
.STRING
,
2357 3: ProtocolBuffer
.Encoder
.STRING
,
2358 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2362 _STYLE_CONTENT_TYPE
= """"""
2363 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImagesCompositeRequest'
2364 class ImagesCompositeResponse(ProtocolBuffer
.ProtocolMessage
):
2367 def __init__(self
, contents
=None):
2368 self
.image_
= ImageData()
2369 if contents
is not None: self
.MergeFromString(contents
)
2371 def image(self
): return self
.image_
2373 def mutable_image(self
): self
.has_image_
= 1; return self
.image_
2375 def clear_image(self
):self
.has_image_
= 0; self
.image_
.Clear()
2377 def has_image(self
): return self
.has_image_
2380 def MergeFrom(self
, x
):
2381 assert x
is not self
2382 if (x
.has_image()): self
.mutable_image().MergeFrom(x
.image())
2384 def Equals(self
, x
):
2385 if x
is self
: return 1
2386 if self
.has_image_
!= x
.has_image_
: return 0
2387 if self
.has_image_
and self
.image_
!= x
.image_
: return 0
2390 def IsInitialized(self
, debug_strs
=None):
2392 if (not self
.has_image_
):
2394 if debug_strs
is not None:
2395 debug_strs
.append('Required field: image not set.')
2396 elif not self
.image_
.IsInitialized(debug_strs
): initialized
= 0
2401 n
+= self
.lengthString(self
.image_
.ByteSize())
2404 def ByteSizePartial(self
):
2406 if (self
.has_image_
):
2408 n
+= self
.lengthString(self
.image_
.ByteSizePartial())
2414 def OutputUnchecked(self
, out
):
2416 out
.putVarInt32(self
.image_
.ByteSize())
2417 self
.image_
.OutputUnchecked(out
)
2419 def OutputPartial(self
, out
):
2420 if (self
.has_image_
):
2422 out
.putVarInt32(self
.image_
.ByteSizePartial())
2423 self
.image_
.OutputPartial(out
)
2425 def TryMerge(self
, d
):
2426 while d
.avail() > 0:
2427 tt
= d
.getVarInt32()
2429 length
= d
.getVarInt32()
2430 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2432 self
.mutable_image().TryMerge(tmp
)
2436 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2440 def __str__(self
, prefix
="", printElemNumber
=0):
2443 res
+=prefix
+"image <\n"
2444 res
+=self
.image_
.__str
__(prefix
+ " ", printElemNumber
)
2449 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2450 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2454 _TEXT
= _BuildTagLookupTable({
2459 _TYPES
= _BuildTagLookupTable({
2460 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2461 1: ProtocolBuffer
.Encoder
.STRING
,
2462 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2466 _STYLE_CONTENT_TYPE
= """"""
2467 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImagesCompositeResponse'
2468 class ImagesHistogramRequest(ProtocolBuffer
.ProtocolMessage
):
2471 def __init__(self
, contents
=None):
2472 self
.image_
= ImageData()
2473 if contents
is not None: self
.MergeFromString(contents
)
2475 def image(self
): return self
.image_
2477 def mutable_image(self
): self
.has_image_
= 1; return self
.image_
2479 def clear_image(self
):self
.has_image_
= 0; self
.image_
.Clear()
2481 def has_image(self
): return self
.has_image_
2484 def MergeFrom(self
, x
):
2485 assert x
is not self
2486 if (x
.has_image()): self
.mutable_image().MergeFrom(x
.image())
2488 def Equals(self
, x
):
2489 if x
is self
: return 1
2490 if self
.has_image_
!= x
.has_image_
: return 0
2491 if self
.has_image_
and self
.image_
!= x
.image_
: return 0
2494 def IsInitialized(self
, debug_strs
=None):
2496 if (not self
.has_image_
):
2498 if debug_strs
is not None:
2499 debug_strs
.append('Required field: image not set.')
2500 elif not self
.image_
.IsInitialized(debug_strs
): initialized
= 0
2505 n
+= self
.lengthString(self
.image_
.ByteSize())
2508 def ByteSizePartial(self
):
2510 if (self
.has_image_
):
2512 n
+= self
.lengthString(self
.image_
.ByteSizePartial())
2518 def OutputUnchecked(self
, out
):
2520 out
.putVarInt32(self
.image_
.ByteSize())
2521 self
.image_
.OutputUnchecked(out
)
2523 def OutputPartial(self
, out
):
2524 if (self
.has_image_
):
2526 out
.putVarInt32(self
.image_
.ByteSizePartial())
2527 self
.image_
.OutputPartial(out
)
2529 def TryMerge(self
, d
):
2530 while d
.avail() > 0:
2531 tt
= d
.getVarInt32()
2533 length
= d
.getVarInt32()
2534 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2536 self
.mutable_image().TryMerge(tmp
)
2540 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2544 def __str__(self
, prefix
="", printElemNumber
=0):
2547 res
+=prefix
+"image <\n"
2548 res
+=self
.image_
.__str
__(prefix
+ " ", printElemNumber
)
2553 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2554 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2558 _TEXT
= _BuildTagLookupTable({
2563 _TYPES
= _BuildTagLookupTable({
2564 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2565 1: ProtocolBuffer
.Encoder
.STRING
,
2566 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2570 _STYLE_CONTENT_TYPE
= """"""
2571 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImagesHistogramRequest'
2572 class ImagesHistogram(ProtocolBuffer
.ProtocolMessage
):
2574 def __init__(self
, contents
=None):
2578 if contents
is not None: self
.MergeFromString(contents
)
2580 def red_size(self
): return len(self
.red_
)
2581 def red_list(self
): return self
.red_
2586 def set_red(self
, i
, x
):
2589 def add_red(self
, x
):
2592 def clear_red(self
):
2595 def green_size(self
): return len(self
.green_
)
2596 def green_list(self
): return self
.green_
2599 return self
.green_
[i
]
2601 def set_green(self
, i
, x
):
2604 def add_green(self
, x
):
2605 self
.green_
.append(x
)
2607 def clear_green(self
):
2610 def blue_size(self
): return len(self
.blue_
)
2611 def blue_list(self
): return self
.blue_
2614 return self
.blue_
[i
]
2616 def set_blue(self
, i
, x
):
2619 def add_blue(self
, x
):
2620 self
.blue_
.append(x
)
2622 def clear_blue(self
):
2626 def MergeFrom(self
, x
):
2627 assert x
is not self
2628 for i
in xrange(x
.red_size()): self
.add_red(x
.red(i
))
2629 for i
in xrange(x
.green_size()): self
.add_green(x
.green(i
))
2630 for i
in xrange(x
.blue_size()): self
.add_blue(x
.blue(i
))
2632 def Equals(self
, x
):
2633 if x
is self
: return 1
2634 if len(self
.red_
) != len(x
.red_
): return 0
2635 for e1
, e2
in zip(self
.red_
, x
.red_
):
2636 if e1
!= e2
: return 0
2637 if len(self
.green_
) != len(x
.green_
): return 0
2638 for e1
, e2
in zip(self
.green_
, x
.green_
):
2639 if e1
!= e2
: return 0
2640 if len(self
.blue_
) != len(x
.blue_
): return 0
2641 for e1
, e2
in zip(self
.blue_
, x
.blue_
):
2642 if e1
!= e2
: return 0
2645 def IsInitialized(self
, debug_strs
=None):
2651 n
+= 1 * len(self
.red_
)
2652 for i
in xrange(len(self
.red_
)): n
+= self
.lengthVarInt64(self
.red_
[i
])
2653 n
+= 1 * len(self
.green_
)
2654 for i
in xrange(len(self
.green_
)): n
+= self
.lengthVarInt64(self
.green_
[i
])
2655 n
+= 1 * len(self
.blue_
)
2656 for i
in xrange(len(self
.blue_
)): n
+= self
.lengthVarInt64(self
.blue_
[i
])
2659 def ByteSizePartial(self
):
2661 n
+= 1 * len(self
.red_
)
2662 for i
in xrange(len(self
.red_
)): n
+= self
.lengthVarInt64(self
.red_
[i
])
2663 n
+= 1 * len(self
.green_
)
2664 for i
in xrange(len(self
.green_
)): n
+= self
.lengthVarInt64(self
.green_
[i
])
2665 n
+= 1 * len(self
.blue_
)
2666 for i
in xrange(len(self
.blue_
)): n
+= self
.lengthVarInt64(self
.blue_
[i
])
2674 def OutputUnchecked(self
, out
):
2675 for i
in xrange(len(self
.red_
)):
2677 out
.putVarInt32(self
.red_
[i
])
2678 for i
in xrange(len(self
.green_
)):
2680 out
.putVarInt32(self
.green_
[i
])
2681 for i
in xrange(len(self
.blue_
)):
2683 out
.putVarInt32(self
.blue_
[i
])
2685 def OutputPartial(self
, out
):
2686 for i
in xrange(len(self
.red_
)):
2688 out
.putVarInt32(self
.red_
[i
])
2689 for i
in xrange(len(self
.green_
)):
2691 out
.putVarInt32(self
.green_
[i
])
2692 for i
in xrange(len(self
.blue_
)):
2694 out
.putVarInt32(self
.blue_
[i
])
2696 def TryMerge(self
, d
):
2697 while d
.avail() > 0:
2698 tt
= d
.getVarInt32()
2700 self
.add_red(d
.getVarInt32())
2703 self
.add_green(d
.getVarInt32())
2706 self
.add_blue(d
.getVarInt32())
2710 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2714 def __str__(self
, prefix
="", printElemNumber
=0):
2719 if printElemNumber
: elm
="(%d)" % cnt
2720 res
+=prefix
+("red%s: %s\n" % (elm
, self
.DebugFormatInt32(e
)))
2723 for e
in self
.green_
:
2725 if printElemNumber
: elm
="(%d)" % cnt
2726 res
+=prefix
+("green%s: %s\n" % (elm
, self
.DebugFormatInt32(e
)))
2729 for e
in self
.blue_
:
2731 if printElemNumber
: elm
="(%d)" % cnt
2732 res
+=prefix
+("blue%s: %s\n" % (elm
, self
.DebugFormatInt32(e
)))
2737 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2738 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2744 _TEXT
= _BuildTagLookupTable({
2751 _TYPES
= _BuildTagLookupTable({
2752 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2753 1: ProtocolBuffer
.Encoder
.NUMERIC
,
2754 2: ProtocolBuffer
.Encoder
.NUMERIC
,
2755 3: ProtocolBuffer
.Encoder
.NUMERIC
,
2756 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2760 _STYLE_CONTENT_TYPE
= """"""
2761 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImagesHistogram'
2762 class ImagesHistogramResponse(ProtocolBuffer
.ProtocolMessage
):
2765 def __init__(self
, contents
=None):
2766 self
.histogram_
= ImagesHistogram()
2767 if contents
is not None: self
.MergeFromString(contents
)
2769 def histogram(self
): return self
.histogram_
2771 def mutable_histogram(self
): self
.has_histogram_
= 1; return self
.histogram_
2773 def clear_histogram(self
):self
.has_histogram_
= 0; self
.histogram_
.Clear()
2775 def has_histogram(self
): return self
.has_histogram_
2778 def MergeFrom(self
, x
):
2779 assert x
is not self
2780 if (x
.has_histogram()): self
.mutable_histogram().MergeFrom(x
.histogram())
2782 def Equals(self
, x
):
2783 if x
is self
: return 1
2784 if self
.has_histogram_
!= x
.has_histogram_
: return 0
2785 if self
.has_histogram_
and self
.histogram_
!= x
.histogram_
: return 0
2788 def IsInitialized(self
, debug_strs
=None):
2790 if (not self
.has_histogram_
):
2792 if debug_strs
is not None:
2793 debug_strs
.append('Required field: histogram not set.')
2794 elif not self
.histogram_
.IsInitialized(debug_strs
): initialized
= 0
2799 n
+= self
.lengthString(self
.histogram_
.ByteSize())
2802 def ByteSizePartial(self
):
2804 if (self
.has_histogram_
):
2806 n
+= self
.lengthString(self
.histogram_
.ByteSizePartial())
2810 self
.clear_histogram()
2812 def OutputUnchecked(self
, out
):
2814 out
.putVarInt32(self
.histogram_
.ByteSize())
2815 self
.histogram_
.OutputUnchecked(out
)
2817 def OutputPartial(self
, out
):
2818 if (self
.has_histogram_
):
2820 out
.putVarInt32(self
.histogram_
.ByteSizePartial())
2821 self
.histogram_
.OutputPartial(out
)
2823 def TryMerge(self
, d
):
2824 while d
.avail() > 0:
2825 tt
= d
.getVarInt32()
2827 length
= d
.getVarInt32()
2828 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2830 self
.mutable_histogram().TryMerge(tmp
)
2834 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2838 def __str__(self
, prefix
="", printElemNumber
=0):
2840 if self
.has_histogram_
:
2841 res
+=prefix
+"histogram <\n"
2842 res
+=self
.histogram_
.__str
__(prefix
+ " ", printElemNumber
)
2847 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2848 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2852 _TEXT
= _BuildTagLookupTable({
2857 _TYPES
= _BuildTagLookupTable({
2858 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2859 1: ProtocolBuffer
.Encoder
.STRING
,
2860 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2864 _STYLE_CONTENT_TYPE
= """"""
2865 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImagesHistogramResponse'
2866 class ImagesGetUrlBaseRequest(ProtocolBuffer
.ProtocolMessage
):
2869 has_create_secure_url_
= 0
2870 create_secure_url_
= 0
2872 def __init__(self
, contents
=None):
2873 if contents
is not None: self
.MergeFromString(contents
)
2875 def blob_key(self
): return self
.blob_key_
2877 def set_blob_key(self
, x
):
2878 self
.has_blob_key_
= 1
2881 def clear_blob_key(self
):
2882 if self
.has_blob_key_
:
2883 self
.has_blob_key_
= 0
2886 def has_blob_key(self
): return self
.has_blob_key_
2888 def create_secure_url(self
): return self
.create_secure_url_
2890 def set_create_secure_url(self
, x
):
2891 self
.has_create_secure_url_
= 1
2892 self
.create_secure_url_
= x
2894 def clear_create_secure_url(self
):
2895 if self
.has_create_secure_url_
:
2896 self
.has_create_secure_url_
= 0
2897 self
.create_secure_url_
= 0
2899 def has_create_secure_url(self
): return self
.has_create_secure_url_
2902 def MergeFrom(self
, x
):
2903 assert x
is not self
2904 if (x
.has_blob_key()): self
.set_blob_key(x
.blob_key())
2905 if (x
.has_create_secure_url()): self
.set_create_secure_url(x
.create_secure_url())
2907 def Equals(self
, x
):
2908 if x
is self
: return 1
2909 if self
.has_blob_key_
!= x
.has_blob_key_
: return 0
2910 if self
.has_blob_key_
and self
.blob_key_
!= x
.blob_key_
: return 0
2911 if self
.has_create_secure_url_
!= x
.has_create_secure_url_
: return 0
2912 if self
.has_create_secure_url_
and self
.create_secure_url_
!= x
.create_secure_url_
: return 0
2915 def IsInitialized(self
, debug_strs
=None):
2917 if (not self
.has_blob_key_
):
2919 if debug_strs
is not None:
2920 debug_strs
.append('Required field: blob_key not set.')
2925 n
+= self
.lengthString(len(self
.blob_key_
))
2926 if (self
.has_create_secure_url_
): n
+= 2
2929 def ByteSizePartial(self
):
2931 if (self
.has_blob_key_
):
2933 n
+= self
.lengthString(len(self
.blob_key_
))
2934 if (self
.has_create_secure_url_
): n
+= 2
2938 self
.clear_blob_key()
2939 self
.clear_create_secure_url()
2941 def OutputUnchecked(self
, out
):
2943 out
.putPrefixedString(self
.blob_key_
)
2944 if (self
.has_create_secure_url_
):
2946 out
.putBoolean(self
.create_secure_url_
)
2948 def OutputPartial(self
, out
):
2949 if (self
.has_blob_key_
):
2951 out
.putPrefixedString(self
.blob_key_
)
2952 if (self
.has_create_secure_url_
):
2954 out
.putBoolean(self
.create_secure_url_
)
2956 def TryMerge(self
, d
):
2957 while d
.avail() > 0:
2958 tt
= d
.getVarInt32()
2960 self
.set_blob_key(d
.getPrefixedString())
2963 self
.set_create_secure_url(d
.getBoolean())
2967 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2971 def __str__(self
, prefix
="", printElemNumber
=0):
2973 if self
.has_blob_key_
: res
+=prefix
+("blob_key: %s\n" % self
.DebugFormatString(self
.blob_key_
))
2974 if self
.has_create_secure_url_
: res
+=prefix
+("create_secure_url: %s\n" % self
.DebugFormatBool(self
.create_secure_url_
))
2978 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2979 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2982 kcreate_secure_url
= 2
2984 _TEXT
= _BuildTagLookupTable({
2987 2: "create_secure_url",
2990 _TYPES
= _BuildTagLookupTable({
2991 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2992 1: ProtocolBuffer
.Encoder
.STRING
,
2993 2: ProtocolBuffer
.Encoder
.NUMERIC
,
2994 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2998 _STYLE_CONTENT_TYPE
= """"""
2999 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImagesGetUrlBaseRequest'
3000 class ImagesGetUrlBaseResponse(ProtocolBuffer
.ProtocolMessage
):
3004 def __init__(self
, contents
=None):
3005 if contents
is not None: self
.MergeFromString(contents
)
3007 def url(self
): return self
.url_
3009 def set_url(self
, x
):
3013 def clear_url(self
):
3018 def has_url(self
): return self
.has_url_
3021 def MergeFrom(self
, x
):
3022 assert x
is not self
3023 if (x
.has_url()): self
.set_url(x
.url())
3025 def Equals(self
, x
):
3026 if x
is self
: return 1
3027 if self
.has_url_
!= x
.has_url_
: return 0
3028 if self
.has_url_
and self
.url_
!= x
.url_
: return 0
3031 def IsInitialized(self
, debug_strs
=None):
3033 if (not self
.has_url_
):
3035 if debug_strs
is not None:
3036 debug_strs
.append('Required field: url not set.')
3041 n
+= self
.lengthString(len(self
.url_
))
3044 def ByteSizePartial(self
):
3048 n
+= self
.lengthString(len(self
.url_
))
3054 def OutputUnchecked(self
, out
):
3056 out
.putPrefixedString(self
.url_
)
3058 def OutputPartial(self
, out
):
3061 out
.putPrefixedString(self
.url_
)
3063 def TryMerge(self
, d
):
3064 while d
.avail() > 0:
3065 tt
= d
.getVarInt32()
3067 self
.set_url(d
.getPrefixedString())
3071 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3075 def __str__(self
, prefix
="", printElemNumber
=0):
3077 if self
.has_url_
: res
+=prefix
+("url: %s\n" % self
.DebugFormatString(self
.url_
))
3081 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3082 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3086 _TEXT
= _BuildTagLookupTable({
3091 _TYPES
= _BuildTagLookupTable({
3092 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3093 1: ProtocolBuffer
.Encoder
.STRING
,
3094 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3098 _STYLE_CONTENT_TYPE
= """"""
3099 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImagesGetUrlBaseResponse'
3100 class ImagesDeleteUrlBaseRequest(ProtocolBuffer
.ProtocolMessage
):
3104 def __init__(self
, contents
=None):
3105 if contents
is not None: self
.MergeFromString(contents
)
3107 def blob_key(self
): return self
.blob_key_
3109 def set_blob_key(self
, x
):
3110 self
.has_blob_key_
= 1
3113 def clear_blob_key(self
):
3114 if self
.has_blob_key_
:
3115 self
.has_blob_key_
= 0
3118 def has_blob_key(self
): return self
.has_blob_key_
3121 def MergeFrom(self
, x
):
3122 assert x
is not self
3123 if (x
.has_blob_key()): self
.set_blob_key(x
.blob_key())
3125 def Equals(self
, x
):
3126 if x
is self
: return 1
3127 if self
.has_blob_key_
!= x
.has_blob_key_
: return 0
3128 if self
.has_blob_key_
and self
.blob_key_
!= x
.blob_key_
: return 0
3131 def IsInitialized(self
, debug_strs
=None):
3133 if (not self
.has_blob_key_
):
3135 if debug_strs
is not None:
3136 debug_strs
.append('Required field: blob_key not set.')
3141 n
+= self
.lengthString(len(self
.blob_key_
))
3144 def ByteSizePartial(self
):
3146 if (self
.has_blob_key_
):
3148 n
+= self
.lengthString(len(self
.blob_key_
))
3152 self
.clear_blob_key()
3154 def OutputUnchecked(self
, out
):
3156 out
.putPrefixedString(self
.blob_key_
)
3158 def OutputPartial(self
, out
):
3159 if (self
.has_blob_key_
):
3161 out
.putPrefixedString(self
.blob_key_
)
3163 def TryMerge(self
, d
):
3164 while d
.avail() > 0:
3165 tt
= d
.getVarInt32()
3167 self
.set_blob_key(d
.getPrefixedString())
3171 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3175 def __str__(self
, prefix
="", printElemNumber
=0):
3177 if self
.has_blob_key_
: res
+=prefix
+("blob_key: %s\n" % self
.DebugFormatString(self
.blob_key_
))
3181 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3182 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3186 _TEXT
= _BuildTagLookupTable({
3191 _TYPES
= _BuildTagLookupTable({
3192 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3193 1: ProtocolBuffer
.Encoder
.STRING
,
3194 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3198 _STYLE_CONTENT_TYPE
= """"""
3199 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImagesDeleteUrlBaseRequest'
3200 class ImagesDeleteUrlBaseResponse(ProtocolBuffer
.ProtocolMessage
):
3202 def __init__(self
, contents
=None):
3204 if contents
is not None: self
.MergeFromString(contents
)
3207 def MergeFrom(self
, x
):
3208 assert x
is not self
3210 def Equals(self
, x
):
3211 if x
is self
: return 1
3214 def IsInitialized(self
, debug_strs
=None):
3222 def ByteSizePartial(self
):
3229 def OutputUnchecked(self
, out
):
3232 def OutputPartial(self
, out
):
3235 def TryMerge(self
, d
):
3236 while d
.avail() > 0:
3237 tt
= d
.getVarInt32()
3240 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3244 def __str__(self
, prefix
="", printElemNumber
=0):
3249 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3250 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3253 _TEXT
= _BuildTagLookupTable({
3257 _TYPES
= _BuildTagLookupTable({
3258 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3259 }, 0, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3263 _STYLE_CONTENT_TYPE
= """"""
3264 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ImagesDeleteUrlBaseResponse'
3265 if _extension_runtime
:
3268 __all__
= ['ImagesServiceError','ImagesServiceTransform','Transform','ImageData','InputSettings','OutputSettings','ImagesTransformRequest','ImagesTransformResponse','CompositeImageOptions','ImagesCanvas','ImagesCompositeRequest','ImagesCompositeResponse','ImagesHistogramRequest','ImagesHistogram','ImagesHistogramResponse','ImagesGetUrlBaseRequest','ImagesGetUrlBaseResponse','ImagesDeleteUrlBaseRequest','ImagesDeleteUrlBaseResponse']