644 1: ProtocolBuffer.Encoder.STRING, |
648 1: ProtocolBuffer.Encoder.STRING, |
645 }, 1, ProtocolBuffer.Encoder.MAX_TYPE) |
649 }, 1, ProtocolBuffer.Encoder.MAX_TYPE) |
646 |
650 |
647 _STYLE = """""" |
651 _STYLE = """""" |
648 _STYLE_CONTENT_TYPE = """""" |
652 _STYLE_CONTENT_TYPE = """""" |
|
653 class TaskQueueDeleteRequest(ProtocolBuffer.ProtocolMessage): |
|
654 has_queue_name_ = 0 |
|
655 queue_name_ = "" |
|
656 has_app_id_ = 0 |
|
657 app_id_ = "" |
|
658 |
|
659 def __init__(self, contents=None): |
|
660 self.task_name_ = [] |
|
661 if contents is not None: self.MergeFromString(contents) |
|
662 |
|
663 def queue_name(self): return self.queue_name_ |
|
664 |
|
665 def set_queue_name(self, x): |
|
666 self.has_queue_name_ = 1 |
|
667 self.queue_name_ = x |
|
668 |
|
669 def clear_queue_name(self): |
|
670 if self.has_queue_name_: |
|
671 self.has_queue_name_ = 0 |
|
672 self.queue_name_ = "" |
|
673 |
|
674 def has_queue_name(self): return self.has_queue_name_ |
|
675 |
|
676 def task_name_size(self): return len(self.task_name_) |
|
677 def task_name_list(self): return self.task_name_ |
|
678 |
|
679 def task_name(self, i): |
|
680 return self.task_name_[i] |
|
681 |
|
682 def set_task_name(self, i, x): |
|
683 self.task_name_[i] = x |
|
684 |
|
685 def add_task_name(self, x): |
|
686 self.task_name_.append(x) |
|
687 |
|
688 def clear_task_name(self): |
|
689 self.task_name_ = [] |
|
690 |
|
691 def app_id(self): return self.app_id_ |
|
692 |
|
693 def set_app_id(self, x): |
|
694 self.has_app_id_ = 1 |
|
695 self.app_id_ = x |
|
696 |
|
697 def clear_app_id(self): |
|
698 if self.has_app_id_: |
|
699 self.has_app_id_ = 0 |
|
700 self.app_id_ = "" |
|
701 |
|
702 def has_app_id(self): return self.has_app_id_ |
|
703 |
|
704 |
|
705 def MergeFrom(self, x): |
|
706 assert x is not self |
|
707 if (x.has_queue_name()): self.set_queue_name(x.queue_name()) |
|
708 for i in xrange(x.task_name_size()): self.add_task_name(x.task_name(i)) |
|
709 if (x.has_app_id()): self.set_app_id(x.app_id()) |
|
710 |
|
711 def Equals(self, x): |
|
712 if x is self: return 1 |
|
713 if self.has_queue_name_ != x.has_queue_name_: return 0 |
|
714 if self.has_queue_name_ and self.queue_name_ != x.queue_name_: return 0 |
|
715 if len(self.task_name_) != len(x.task_name_): return 0 |
|
716 for e1, e2 in zip(self.task_name_, x.task_name_): |
|
717 if e1 != e2: return 0 |
|
718 if self.has_app_id_ != x.has_app_id_: return 0 |
|
719 if self.has_app_id_ and self.app_id_ != x.app_id_: return 0 |
|
720 return 1 |
|
721 |
|
722 def IsInitialized(self, debug_strs=None): |
|
723 initialized = 1 |
|
724 if (not self.has_queue_name_): |
|
725 initialized = 0 |
|
726 if debug_strs is not None: |
|
727 debug_strs.append('Required field: queue_name not set.') |
|
728 return initialized |
|
729 |
|
730 def ByteSize(self): |
|
731 n = 0 |
|
732 n += self.lengthString(len(self.queue_name_)) |
|
733 n += 1 * len(self.task_name_) |
|
734 for i in xrange(len(self.task_name_)): n += self.lengthString(len(self.task_name_[i])) |
|
735 if (self.has_app_id_): n += 1 + self.lengthString(len(self.app_id_)) |
|
736 return n + 1 |
|
737 |
|
738 def Clear(self): |
|
739 self.clear_queue_name() |
|
740 self.clear_task_name() |
|
741 self.clear_app_id() |
|
742 |
|
743 def OutputUnchecked(self, out): |
|
744 out.putVarInt32(10) |
|
745 out.putPrefixedString(self.queue_name_) |
|
746 for i in xrange(len(self.task_name_)): |
|
747 out.putVarInt32(18) |
|
748 out.putPrefixedString(self.task_name_[i]) |
|
749 if (self.has_app_id_): |
|
750 out.putVarInt32(26) |
|
751 out.putPrefixedString(self.app_id_) |
|
752 |
|
753 def TryMerge(self, d): |
|
754 while d.avail() > 0: |
|
755 tt = d.getVarInt32() |
|
756 if tt == 10: |
|
757 self.set_queue_name(d.getPrefixedString()) |
|
758 continue |
|
759 if tt == 18: |
|
760 self.add_task_name(d.getPrefixedString()) |
|
761 continue |
|
762 if tt == 26: |
|
763 self.set_app_id(d.getPrefixedString()) |
|
764 continue |
|
765 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
766 d.skipData(tt) |
|
767 |
|
768 |
|
769 def __str__(self, prefix="", printElemNumber=0): |
|
770 res="" |
|
771 if self.has_queue_name_: res+=prefix+("queue_name: %s\n" % self.DebugFormatString(self.queue_name_)) |
|
772 cnt=0 |
|
773 for e in self.task_name_: |
|
774 elm="" |
|
775 if printElemNumber: elm="(%d)" % cnt |
|
776 res+=prefix+("task_name%s: %s\n" % (elm, self.DebugFormatString(e))) |
|
777 cnt+=1 |
|
778 if self.has_app_id_: res+=prefix+("app_id: %s\n" % self.DebugFormatString(self.app_id_)) |
|
779 return res |
|
780 |
|
781 |
|
782 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
783 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
784 |
|
785 kqueue_name = 1 |
|
786 ktask_name = 2 |
|
787 kapp_id = 3 |
|
788 |
|
789 _TEXT = _BuildTagLookupTable({ |
|
790 0: "ErrorCode", |
|
791 1: "queue_name", |
|
792 2: "task_name", |
|
793 3: "app_id", |
|
794 }, 3) |
|
795 |
|
796 _TYPES = _BuildTagLookupTable({ |
|
797 0: ProtocolBuffer.Encoder.NUMERIC, |
|
798 1: ProtocolBuffer.Encoder.STRING, |
|
799 2: ProtocolBuffer.Encoder.STRING, |
|
800 3: ProtocolBuffer.Encoder.STRING, |
|
801 }, 3, ProtocolBuffer.Encoder.MAX_TYPE) |
|
802 |
|
803 _STYLE = """""" |
|
804 _STYLE_CONTENT_TYPE = """""" |
|
805 class TaskQueueDeleteResponse(ProtocolBuffer.ProtocolMessage): |
|
806 |
|
807 def __init__(self, contents=None): |
|
808 self.result_ = [] |
|
809 if contents is not None: self.MergeFromString(contents) |
|
810 |
|
811 def result_size(self): return len(self.result_) |
|
812 def result_list(self): return self.result_ |
|
813 |
|
814 def result(self, i): |
|
815 return self.result_[i] |
|
816 |
|
817 def set_result(self, i, x): |
|
818 self.result_[i] = x |
|
819 |
|
820 def add_result(self, x): |
|
821 self.result_.append(x) |
|
822 |
|
823 def clear_result(self): |
|
824 self.result_ = [] |
|
825 |
|
826 |
|
827 def MergeFrom(self, x): |
|
828 assert x is not self |
|
829 for i in xrange(x.result_size()): self.add_result(x.result(i)) |
|
830 |
|
831 def Equals(self, x): |
|
832 if x is self: return 1 |
|
833 if len(self.result_) != len(x.result_): return 0 |
|
834 for e1, e2 in zip(self.result_, x.result_): |
|
835 if e1 != e2: return 0 |
|
836 return 1 |
|
837 |
|
838 def IsInitialized(self, debug_strs=None): |
|
839 initialized = 1 |
|
840 return initialized |
|
841 |
|
842 def ByteSize(self): |
|
843 n = 0 |
|
844 n += 1 * len(self.result_) |
|
845 for i in xrange(len(self.result_)): n += self.lengthVarInt64(self.result_[i]) |
|
846 return n + 0 |
|
847 |
|
848 def Clear(self): |
|
849 self.clear_result() |
|
850 |
|
851 def OutputUnchecked(self, out): |
|
852 for i in xrange(len(self.result_)): |
|
853 out.putVarInt32(24) |
|
854 out.putVarInt32(self.result_[i]) |
|
855 |
|
856 def TryMerge(self, d): |
|
857 while d.avail() > 0: |
|
858 tt = d.getVarInt32() |
|
859 if tt == 24: |
|
860 self.add_result(d.getVarInt32()) |
|
861 continue |
|
862 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
863 d.skipData(tt) |
|
864 |
|
865 |
|
866 def __str__(self, prefix="", printElemNumber=0): |
|
867 res="" |
|
868 cnt=0 |
|
869 for e in self.result_: |
|
870 elm="" |
|
871 if printElemNumber: elm="(%d)" % cnt |
|
872 res+=prefix+("result%s: %s\n" % (elm, self.DebugFormatInt32(e))) |
|
873 cnt+=1 |
|
874 return res |
|
875 |
|
876 |
|
877 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
878 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
879 |
|
880 kresult = 3 |
|
881 |
|
882 _TEXT = _BuildTagLookupTable({ |
|
883 0: "ErrorCode", |
|
884 3: "result", |
|
885 }, 3) |
|
886 |
|
887 _TYPES = _BuildTagLookupTable({ |
|
888 0: ProtocolBuffer.Encoder.NUMERIC, |
|
889 3: ProtocolBuffer.Encoder.NUMERIC, |
|
890 }, 3, ProtocolBuffer.Encoder.MAX_TYPE) |
|
891 |
|
892 _STYLE = """""" |
|
893 _STYLE_CONTENT_TYPE = """""" |
649 class TaskQueueUpdateQueueRequest(ProtocolBuffer.ProtocolMessage): |
894 class TaskQueueUpdateQueueRequest(ProtocolBuffer.ProtocolMessage): |
650 has_app_id_ = 0 |
895 has_app_id_ = 0 |
651 app_id_ = "" |
896 app_id_ = "" |
652 has_queue_name_ = 0 |
897 has_queue_name_ = 0 |
653 queue_name_ = "" |
898 queue_name_ = "" |
1441 3: ProtocolBuffer.Encoder.NUMERIC, |
1686 3: ProtocolBuffer.Encoder.NUMERIC, |
1442 }, 3, ProtocolBuffer.Encoder.MAX_TYPE) |
1687 }, 3, ProtocolBuffer.Encoder.MAX_TYPE) |
1443 |
1688 |
1444 _STYLE = """""" |
1689 _STYLE = """""" |
1445 _STYLE_CONTENT_TYPE = """""" |
1690 _STYLE_CONTENT_TYPE = """""" |
|
1691 class TaskQueueScannerQueueInfo(ProtocolBuffer.ProtocolMessage): |
|
1692 has_executed_last_minute_ = 0 |
|
1693 executed_last_minute_ = 0 |
|
1694 has_executed_last_hour_ = 0 |
|
1695 executed_last_hour_ = 0 |
|
1696 has_sampling_duration_seconds_ = 0 |
|
1697 sampling_duration_seconds_ = 0.0 |
|
1698 |
|
1699 def __init__(self, contents=None): |
|
1700 if contents is not None: self.MergeFromString(contents) |
|
1701 |
|
1702 def executed_last_minute(self): return self.executed_last_minute_ |
|
1703 |
|
1704 def set_executed_last_minute(self, x): |
|
1705 self.has_executed_last_minute_ = 1 |
|
1706 self.executed_last_minute_ = x |
|
1707 |
|
1708 def clear_executed_last_minute(self): |
|
1709 if self.has_executed_last_minute_: |
|
1710 self.has_executed_last_minute_ = 0 |
|
1711 self.executed_last_minute_ = 0 |
|
1712 |
|
1713 def has_executed_last_minute(self): return self.has_executed_last_minute_ |
|
1714 |
|
1715 def executed_last_hour(self): return self.executed_last_hour_ |
|
1716 |
|
1717 def set_executed_last_hour(self, x): |
|
1718 self.has_executed_last_hour_ = 1 |
|
1719 self.executed_last_hour_ = x |
|
1720 |
|
1721 def clear_executed_last_hour(self): |
|
1722 if self.has_executed_last_hour_: |
|
1723 self.has_executed_last_hour_ = 0 |
|
1724 self.executed_last_hour_ = 0 |
|
1725 |
|
1726 def has_executed_last_hour(self): return self.has_executed_last_hour_ |
|
1727 |
|
1728 def sampling_duration_seconds(self): return self.sampling_duration_seconds_ |
|
1729 |
|
1730 def set_sampling_duration_seconds(self, x): |
|
1731 self.has_sampling_duration_seconds_ = 1 |
|
1732 self.sampling_duration_seconds_ = x |
|
1733 |
|
1734 def clear_sampling_duration_seconds(self): |
|
1735 if self.has_sampling_duration_seconds_: |
|
1736 self.has_sampling_duration_seconds_ = 0 |
|
1737 self.sampling_duration_seconds_ = 0.0 |
|
1738 |
|
1739 def has_sampling_duration_seconds(self): return self.has_sampling_duration_seconds_ |
|
1740 |
|
1741 |
|
1742 def MergeFrom(self, x): |
|
1743 assert x is not self |
|
1744 if (x.has_executed_last_minute()): self.set_executed_last_minute(x.executed_last_minute()) |
|
1745 if (x.has_executed_last_hour()): self.set_executed_last_hour(x.executed_last_hour()) |
|
1746 if (x.has_sampling_duration_seconds()): self.set_sampling_duration_seconds(x.sampling_duration_seconds()) |
|
1747 |
|
1748 def Equals(self, x): |
|
1749 if x is self: return 1 |
|
1750 if self.has_executed_last_minute_ != x.has_executed_last_minute_: return 0 |
|
1751 if self.has_executed_last_minute_ and self.executed_last_minute_ != x.executed_last_minute_: return 0 |
|
1752 if self.has_executed_last_hour_ != x.has_executed_last_hour_: return 0 |
|
1753 if self.has_executed_last_hour_ and self.executed_last_hour_ != x.executed_last_hour_: return 0 |
|
1754 if self.has_sampling_duration_seconds_ != x.has_sampling_duration_seconds_: return 0 |
|
1755 if self.has_sampling_duration_seconds_ and self.sampling_duration_seconds_ != x.sampling_duration_seconds_: return 0 |
|
1756 return 1 |
|
1757 |
|
1758 def IsInitialized(self, debug_strs=None): |
|
1759 initialized = 1 |
|
1760 if (not self.has_executed_last_minute_): |
|
1761 initialized = 0 |
|
1762 if debug_strs is not None: |
|
1763 debug_strs.append('Required field: executed_last_minute not set.') |
|
1764 if (not self.has_executed_last_hour_): |
|
1765 initialized = 0 |
|
1766 if debug_strs is not None: |
|
1767 debug_strs.append('Required field: executed_last_hour not set.') |
|
1768 if (not self.has_sampling_duration_seconds_): |
|
1769 initialized = 0 |
|
1770 if debug_strs is not None: |
|
1771 debug_strs.append('Required field: sampling_duration_seconds not set.') |
|
1772 return initialized |
|
1773 |
|
1774 def ByteSize(self): |
|
1775 n = 0 |
|
1776 n += self.lengthVarInt64(self.executed_last_minute_) |
|
1777 n += self.lengthVarInt64(self.executed_last_hour_) |
|
1778 return n + 11 |
|
1779 |
|
1780 def Clear(self): |
|
1781 self.clear_executed_last_minute() |
|
1782 self.clear_executed_last_hour() |
|
1783 self.clear_sampling_duration_seconds() |
|
1784 |
|
1785 def OutputUnchecked(self, out): |
|
1786 out.putVarInt32(8) |
|
1787 out.putVarInt64(self.executed_last_minute_) |
|
1788 out.putVarInt32(16) |
|
1789 out.putVarInt64(self.executed_last_hour_) |
|
1790 out.putVarInt32(25) |
|
1791 out.putDouble(self.sampling_duration_seconds_) |
|
1792 |
|
1793 def TryMerge(self, d): |
|
1794 while d.avail() > 0: |
|
1795 tt = d.getVarInt32() |
|
1796 if tt == 8: |
|
1797 self.set_executed_last_minute(d.getVarInt64()) |
|
1798 continue |
|
1799 if tt == 16: |
|
1800 self.set_executed_last_hour(d.getVarInt64()) |
|
1801 continue |
|
1802 if tt == 25: |
|
1803 self.set_sampling_duration_seconds(d.getDouble()) |
|
1804 continue |
|
1805 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
1806 d.skipData(tt) |
|
1807 |
|
1808 |
|
1809 def __str__(self, prefix="", printElemNumber=0): |
|
1810 res="" |
|
1811 if self.has_executed_last_minute_: res+=prefix+("executed_last_minute: %s\n" % self.DebugFormatInt64(self.executed_last_minute_)) |
|
1812 if self.has_executed_last_hour_: res+=prefix+("executed_last_hour: %s\n" % self.DebugFormatInt64(self.executed_last_hour_)) |
|
1813 if self.has_sampling_duration_seconds_: res+=prefix+("sampling_duration_seconds: %s\n" % self.DebugFormat(self.sampling_duration_seconds_)) |
|
1814 return res |
|
1815 |
|
1816 |
|
1817 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
1818 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
1819 |
|
1820 kexecuted_last_minute = 1 |
|
1821 kexecuted_last_hour = 2 |
|
1822 ksampling_duration_seconds = 3 |
|
1823 |
|
1824 _TEXT = _BuildTagLookupTable({ |
|
1825 0: "ErrorCode", |
|
1826 1: "executed_last_minute", |
|
1827 2: "executed_last_hour", |
|
1828 3: "sampling_duration_seconds", |
|
1829 }, 3) |
|
1830 |
|
1831 _TYPES = _BuildTagLookupTable({ |
|
1832 0: ProtocolBuffer.Encoder.NUMERIC, |
|
1833 1: ProtocolBuffer.Encoder.NUMERIC, |
|
1834 2: ProtocolBuffer.Encoder.NUMERIC, |
|
1835 3: ProtocolBuffer.Encoder.DOUBLE, |
|
1836 }, 3, ProtocolBuffer.Encoder.MAX_TYPE) |
|
1837 |
|
1838 _STYLE = """""" |
|
1839 _STYLE_CONTENT_TYPE = """""" |
1446 class TaskQueueFetchQueueStatsResponse_QueueStats(ProtocolBuffer.ProtocolMessage): |
1840 class TaskQueueFetchQueueStatsResponse_QueueStats(ProtocolBuffer.ProtocolMessage): |
1447 has_num_tasks_ = 0 |
1841 has_num_tasks_ = 0 |
1448 num_tasks_ = 0 |
1842 num_tasks_ = 0 |
1449 has_oldest_eta_usec_ = 0 |
1843 has_oldest_eta_usec_ = 0 |
1450 oldest_eta_usec_ = 0 |
1844 oldest_eta_usec_ = 0 |
|
1845 has_scanner_info_ = 0 |
|
1846 scanner_info_ = None |
1451 |
1847 |
1452 def __init__(self, contents=None): |
1848 def __init__(self, contents=None): |
|
1849 self.lazy_init_lock_ = thread.allocate_lock() |
1453 if contents is not None: self.MergeFromString(contents) |
1850 if contents is not None: self.MergeFromString(contents) |
1454 |
1851 |
1455 def num_tasks(self): return self.num_tasks_ |
1852 def num_tasks(self): return self.num_tasks_ |
1456 |
1853 |
1457 def set_num_tasks(self, x): |
1854 def set_num_tasks(self, x): |
1622 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
2057 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
1623 |
2058 |
1624 kQueueStatsGroup = 1 |
2059 kQueueStatsGroup = 1 |
1625 kQueueStatsnum_tasks = 2 |
2060 kQueueStatsnum_tasks = 2 |
1626 kQueueStatsoldest_eta_usec = 3 |
2061 kQueueStatsoldest_eta_usec = 3 |
|
2062 kQueueStatsscanner_info = 4 |
1627 |
2063 |
1628 _TEXT = _BuildTagLookupTable({ |
2064 _TEXT = _BuildTagLookupTable({ |
1629 0: "ErrorCode", |
2065 0: "ErrorCode", |
1630 1: "QueueStats", |
2066 1: "QueueStats", |
1631 2: "num_tasks", |
2067 2: "num_tasks", |
1632 3: "oldest_eta_usec", |
2068 3: "oldest_eta_usec", |
1633 }, 3) |
2069 4: "scanner_info", |
|
2070 }, 4) |
1634 |
2071 |
1635 _TYPES = _BuildTagLookupTable({ |
2072 _TYPES = _BuildTagLookupTable({ |
1636 0: ProtocolBuffer.Encoder.NUMERIC, |
2073 0: ProtocolBuffer.Encoder.NUMERIC, |
1637 1: ProtocolBuffer.Encoder.STARTGROUP, |
2074 1: ProtocolBuffer.Encoder.STARTGROUP, |
1638 2: ProtocolBuffer.Encoder.NUMERIC, |
2075 2: ProtocolBuffer.Encoder.NUMERIC, |
1639 3: ProtocolBuffer.Encoder.NUMERIC, |
2076 3: ProtocolBuffer.Encoder.NUMERIC, |
1640 }, 3, ProtocolBuffer.Encoder.MAX_TYPE) |
2077 4: ProtocolBuffer.Encoder.STRING, |
|
2078 }, 4, ProtocolBuffer.Encoder.MAX_TYPE) |
1641 |
2079 |
1642 _STYLE = """""" |
2080 _STYLE = """""" |
1643 _STYLE_CONTENT_TYPE = """""" |
2081 _STYLE_CONTENT_TYPE = """""" |
1644 |
2082 class TaskQueueDeleteQueueRequest(ProtocolBuffer.ProtocolMessage): |
1645 __all__ = ['TaskQueueServiceError','TaskQueueAddRequest','TaskQueueAddRequest_Header','TaskQueueAddResponse','TaskQueueUpdateQueueRequest','TaskQueueUpdateQueueResponse','TaskQueueFetchQueuesRequest','TaskQueueFetchQueuesResponse','TaskQueueFetchQueuesResponse_Queue','TaskQueueFetchQueueStatsRequest','TaskQueueFetchQueueStatsResponse','TaskQueueFetchQueueStatsResponse_QueueStats'] |
2083 has_app_id_ = 0 |
|
2084 app_id_ = "" |
|
2085 has_queue_name_ = 0 |
|
2086 queue_name_ = "" |
|
2087 |
|
2088 def __init__(self, contents=None): |
|
2089 if contents is not None: self.MergeFromString(contents) |
|
2090 |
|
2091 def app_id(self): return self.app_id_ |
|
2092 |
|
2093 def set_app_id(self, x): |
|
2094 self.has_app_id_ = 1 |
|
2095 self.app_id_ = x |
|
2096 |
|
2097 def clear_app_id(self): |
|
2098 if self.has_app_id_: |
|
2099 self.has_app_id_ = 0 |
|
2100 self.app_id_ = "" |
|
2101 |
|
2102 def has_app_id(self): return self.has_app_id_ |
|
2103 |
|
2104 def queue_name(self): return self.queue_name_ |
|
2105 |
|
2106 def set_queue_name(self, x): |
|
2107 self.has_queue_name_ = 1 |
|
2108 self.queue_name_ = x |
|
2109 |
|
2110 def clear_queue_name(self): |
|
2111 if self.has_queue_name_: |
|
2112 self.has_queue_name_ = 0 |
|
2113 self.queue_name_ = "" |
|
2114 |
|
2115 def has_queue_name(self): return self.has_queue_name_ |
|
2116 |
|
2117 |
|
2118 def MergeFrom(self, x): |
|
2119 assert x is not self |
|
2120 if (x.has_app_id()): self.set_app_id(x.app_id()) |
|
2121 if (x.has_queue_name()): self.set_queue_name(x.queue_name()) |
|
2122 |
|
2123 def Equals(self, x): |
|
2124 if x is self: return 1 |
|
2125 if self.has_app_id_ != x.has_app_id_: return 0 |
|
2126 if self.has_app_id_ and self.app_id_ != x.app_id_: return 0 |
|
2127 if self.has_queue_name_ != x.has_queue_name_: return 0 |
|
2128 if self.has_queue_name_ and self.queue_name_ != x.queue_name_: return 0 |
|
2129 return 1 |
|
2130 |
|
2131 def IsInitialized(self, debug_strs=None): |
|
2132 initialized = 1 |
|
2133 if (not self.has_app_id_): |
|
2134 initialized = 0 |
|
2135 if debug_strs is not None: |
|
2136 debug_strs.append('Required field: app_id not set.') |
|
2137 if (not self.has_queue_name_): |
|
2138 initialized = 0 |
|
2139 if debug_strs is not None: |
|
2140 debug_strs.append('Required field: queue_name not set.') |
|
2141 return initialized |
|
2142 |
|
2143 def ByteSize(self): |
|
2144 n = 0 |
|
2145 n += self.lengthString(len(self.app_id_)) |
|
2146 n += self.lengthString(len(self.queue_name_)) |
|
2147 return n + 2 |
|
2148 |
|
2149 def Clear(self): |
|
2150 self.clear_app_id() |
|
2151 self.clear_queue_name() |
|
2152 |
|
2153 def OutputUnchecked(self, out): |
|
2154 out.putVarInt32(10) |
|
2155 out.putPrefixedString(self.app_id_) |
|
2156 out.putVarInt32(18) |
|
2157 out.putPrefixedString(self.queue_name_) |
|
2158 |
|
2159 def TryMerge(self, d): |
|
2160 while d.avail() > 0: |
|
2161 tt = d.getVarInt32() |
|
2162 if tt == 10: |
|
2163 self.set_app_id(d.getPrefixedString()) |
|
2164 continue |
|
2165 if tt == 18: |
|
2166 self.set_queue_name(d.getPrefixedString()) |
|
2167 continue |
|
2168 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
2169 d.skipData(tt) |
|
2170 |
|
2171 |
|
2172 def __str__(self, prefix="", printElemNumber=0): |
|
2173 res="" |
|
2174 if self.has_app_id_: res+=prefix+("app_id: %s\n" % self.DebugFormatString(self.app_id_)) |
|
2175 if self.has_queue_name_: res+=prefix+("queue_name: %s\n" % self.DebugFormatString(self.queue_name_)) |
|
2176 return res |
|
2177 |
|
2178 |
|
2179 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
2180 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
2181 |
|
2182 kapp_id = 1 |
|
2183 kqueue_name = 2 |
|
2184 |
|
2185 _TEXT = _BuildTagLookupTable({ |
|
2186 0: "ErrorCode", |
|
2187 1: "app_id", |
|
2188 2: "queue_name", |
|
2189 }, 2) |
|
2190 |
|
2191 _TYPES = _BuildTagLookupTable({ |
|
2192 0: ProtocolBuffer.Encoder.NUMERIC, |
|
2193 1: ProtocolBuffer.Encoder.STRING, |
|
2194 2: ProtocolBuffer.Encoder.STRING, |
|
2195 }, 2, ProtocolBuffer.Encoder.MAX_TYPE) |
|
2196 |
|
2197 _STYLE = """""" |
|
2198 _STYLE_CONTENT_TYPE = """""" |
|
2199 class TaskQueueDeleteQueueResponse(ProtocolBuffer.ProtocolMessage): |
|
2200 |
|
2201 def __init__(self, contents=None): |
|
2202 pass |
|
2203 if contents is not None: self.MergeFromString(contents) |
|
2204 |
|
2205 |
|
2206 def MergeFrom(self, x): |
|
2207 assert x is not self |
|
2208 |
|
2209 def Equals(self, x): |
|
2210 if x is self: return 1 |
|
2211 return 1 |
|
2212 |
|
2213 def IsInitialized(self, debug_strs=None): |
|
2214 initialized = 1 |
|
2215 return initialized |
|
2216 |
|
2217 def ByteSize(self): |
|
2218 n = 0 |
|
2219 return n + 0 |
|
2220 |
|
2221 def Clear(self): |
|
2222 pass |
|
2223 |
|
2224 def OutputUnchecked(self, out): |
|
2225 pass |
|
2226 |
|
2227 def TryMerge(self, d): |
|
2228 while d.avail() > 0: |
|
2229 tt = d.getVarInt32() |
|
2230 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
2231 d.skipData(tt) |
|
2232 |
|
2233 |
|
2234 def __str__(self, prefix="", printElemNumber=0): |
|
2235 res="" |
|
2236 return res |
|
2237 |
|
2238 |
|
2239 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
2240 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
2241 |
|
2242 |
|
2243 _TEXT = _BuildTagLookupTable({ |
|
2244 0: "ErrorCode", |
|
2245 }, 0) |
|
2246 |
|
2247 _TYPES = _BuildTagLookupTable({ |
|
2248 0: ProtocolBuffer.Encoder.NUMERIC, |
|
2249 }, 0, ProtocolBuffer.Encoder.MAX_TYPE) |
|
2250 |
|
2251 _STYLE = """""" |
|
2252 _STYLE_CONTENT_TYPE = """""" |
|
2253 class TaskQueueQueryTasksRequest(ProtocolBuffer.ProtocolMessage): |
|
2254 has_app_id_ = 0 |
|
2255 app_id_ = "" |
|
2256 has_queue_name_ = 0 |
|
2257 queue_name_ = "" |
|
2258 has_start_task_name_ = 0 |
|
2259 start_task_name_ = "" |
|
2260 has_start_eta_usec_ = 0 |
|
2261 start_eta_usec_ = 0 |
|
2262 has_max_rows_ = 0 |
|
2263 max_rows_ = 1 |
|
2264 |
|
2265 def __init__(self, contents=None): |
|
2266 if contents is not None: self.MergeFromString(contents) |
|
2267 |
|
2268 def app_id(self): return self.app_id_ |
|
2269 |
|
2270 def set_app_id(self, x): |
|
2271 self.has_app_id_ = 1 |
|
2272 self.app_id_ = x |
|
2273 |
|
2274 def clear_app_id(self): |
|
2275 if self.has_app_id_: |
|
2276 self.has_app_id_ = 0 |
|
2277 self.app_id_ = "" |
|
2278 |
|
2279 def has_app_id(self): return self.has_app_id_ |
|
2280 |
|
2281 def queue_name(self): return self.queue_name_ |
|
2282 |
|
2283 def set_queue_name(self, x): |
|
2284 self.has_queue_name_ = 1 |
|
2285 self.queue_name_ = x |
|
2286 |
|
2287 def clear_queue_name(self): |
|
2288 if self.has_queue_name_: |
|
2289 self.has_queue_name_ = 0 |
|
2290 self.queue_name_ = "" |
|
2291 |
|
2292 def has_queue_name(self): return self.has_queue_name_ |
|
2293 |
|
2294 def start_task_name(self): return self.start_task_name_ |
|
2295 |
|
2296 def set_start_task_name(self, x): |
|
2297 self.has_start_task_name_ = 1 |
|
2298 self.start_task_name_ = x |
|
2299 |
|
2300 def clear_start_task_name(self): |
|
2301 if self.has_start_task_name_: |
|
2302 self.has_start_task_name_ = 0 |
|
2303 self.start_task_name_ = "" |
|
2304 |
|
2305 def has_start_task_name(self): return self.has_start_task_name_ |
|
2306 |
|
2307 def start_eta_usec(self): return self.start_eta_usec_ |
|
2308 |
|
2309 def set_start_eta_usec(self, x): |
|
2310 self.has_start_eta_usec_ = 1 |
|
2311 self.start_eta_usec_ = x |
|
2312 |
|
2313 def clear_start_eta_usec(self): |
|
2314 if self.has_start_eta_usec_: |
|
2315 self.has_start_eta_usec_ = 0 |
|
2316 self.start_eta_usec_ = 0 |
|
2317 |
|
2318 def has_start_eta_usec(self): return self.has_start_eta_usec_ |
|
2319 |
|
2320 def max_rows(self): return self.max_rows_ |
|
2321 |
|
2322 def set_max_rows(self, x): |
|
2323 self.has_max_rows_ = 1 |
|
2324 self.max_rows_ = x |
|
2325 |
|
2326 def clear_max_rows(self): |
|
2327 if self.has_max_rows_: |
|
2328 self.has_max_rows_ = 0 |
|
2329 self.max_rows_ = 1 |
|
2330 |
|
2331 def has_max_rows(self): return self.has_max_rows_ |
|
2332 |
|
2333 |
|
2334 def MergeFrom(self, x): |
|
2335 assert x is not self |
|
2336 if (x.has_app_id()): self.set_app_id(x.app_id()) |
|
2337 if (x.has_queue_name()): self.set_queue_name(x.queue_name()) |
|
2338 if (x.has_start_task_name()): self.set_start_task_name(x.start_task_name()) |
|
2339 if (x.has_start_eta_usec()): self.set_start_eta_usec(x.start_eta_usec()) |
|
2340 if (x.has_max_rows()): self.set_max_rows(x.max_rows()) |
|
2341 |
|
2342 def Equals(self, x): |
|
2343 if x is self: return 1 |
|
2344 if self.has_app_id_ != x.has_app_id_: return 0 |
|
2345 if self.has_app_id_ and self.app_id_ != x.app_id_: return 0 |
|
2346 if self.has_queue_name_ != x.has_queue_name_: return 0 |
|
2347 if self.has_queue_name_ and self.queue_name_ != x.queue_name_: return 0 |
|
2348 if self.has_start_task_name_ != x.has_start_task_name_: return 0 |
|
2349 if self.has_start_task_name_ and self.start_task_name_ != x.start_task_name_: return 0 |
|
2350 if self.has_start_eta_usec_ != x.has_start_eta_usec_: return 0 |
|
2351 if self.has_start_eta_usec_ and self.start_eta_usec_ != x.start_eta_usec_: return 0 |
|
2352 if self.has_max_rows_ != x.has_max_rows_: return 0 |
|
2353 if self.has_max_rows_ and self.max_rows_ != x.max_rows_: return 0 |
|
2354 return 1 |
|
2355 |
|
2356 def IsInitialized(self, debug_strs=None): |
|
2357 initialized = 1 |
|
2358 if (not self.has_app_id_): |
|
2359 initialized = 0 |
|
2360 if debug_strs is not None: |
|
2361 debug_strs.append('Required field: app_id not set.') |
|
2362 if (not self.has_queue_name_): |
|
2363 initialized = 0 |
|
2364 if debug_strs is not None: |
|
2365 debug_strs.append('Required field: queue_name not set.') |
|
2366 return initialized |
|
2367 |
|
2368 def ByteSize(self): |
|
2369 n = 0 |
|
2370 n += self.lengthString(len(self.app_id_)) |
|
2371 n += self.lengthString(len(self.queue_name_)) |
|
2372 if (self.has_start_task_name_): n += 1 + self.lengthString(len(self.start_task_name_)) |
|
2373 if (self.has_start_eta_usec_): n += 1 + self.lengthVarInt64(self.start_eta_usec_) |
|
2374 if (self.has_max_rows_): n += 1 + self.lengthVarInt64(self.max_rows_) |
|
2375 return n + 2 |
|
2376 |
|
2377 def Clear(self): |
|
2378 self.clear_app_id() |
|
2379 self.clear_queue_name() |
|
2380 self.clear_start_task_name() |
|
2381 self.clear_start_eta_usec() |
|
2382 self.clear_max_rows() |
|
2383 |
|
2384 def OutputUnchecked(self, out): |
|
2385 out.putVarInt32(10) |
|
2386 out.putPrefixedString(self.app_id_) |
|
2387 out.putVarInt32(18) |
|
2388 out.putPrefixedString(self.queue_name_) |
|
2389 if (self.has_start_task_name_): |
|
2390 out.putVarInt32(26) |
|
2391 out.putPrefixedString(self.start_task_name_) |
|
2392 if (self.has_start_eta_usec_): |
|
2393 out.putVarInt32(32) |
|
2394 out.putVarInt64(self.start_eta_usec_) |
|
2395 if (self.has_max_rows_): |
|
2396 out.putVarInt32(40) |
|
2397 out.putVarInt32(self.max_rows_) |
|
2398 |
|
2399 def TryMerge(self, d): |
|
2400 while d.avail() > 0: |
|
2401 tt = d.getVarInt32() |
|
2402 if tt == 10: |
|
2403 self.set_app_id(d.getPrefixedString()) |
|
2404 continue |
|
2405 if tt == 18: |
|
2406 self.set_queue_name(d.getPrefixedString()) |
|
2407 continue |
|
2408 if tt == 26: |
|
2409 self.set_start_task_name(d.getPrefixedString()) |
|
2410 continue |
|
2411 if tt == 32: |
|
2412 self.set_start_eta_usec(d.getVarInt64()) |
|
2413 continue |
|
2414 if tt == 40: |
|
2415 self.set_max_rows(d.getVarInt32()) |
|
2416 continue |
|
2417 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
2418 d.skipData(tt) |
|
2419 |
|
2420 |
|
2421 def __str__(self, prefix="", printElemNumber=0): |
|
2422 res="" |
|
2423 if self.has_app_id_: res+=prefix+("app_id: %s\n" % self.DebugFormatString(self.app_id_)) |
|
2424 if self.has_queue_name_: res+=prefix+("queue_name: %s\n" % self.DebugFormatString(self.queue_name_)) |
|
2425 if self.has_start_task_name_: res+=prefix+("start_task_name: %s\n" % self.DebugFormatString(self.start_task_name_)) |
|
2426 if self.has_start_eta_usec_: res+=prefix+("start_eta_usec: %s\n" % self.DebugFormatInt64(self.start_eta_usec_)) |
|
2427 if self.has_max_rows_: res+=prefix+("max_rows: %s\n" % self.DebugFormatInt32(self.max_rows_)) |
|
2428 return res |
|
2429 |
|
2430 |
|
2431 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
2432 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
2433 |
|
2434 kapp_id = 1 |
|
2435 kqueue_name = 2 |
|
2436 kstart_task_name = 3 |
|
2437 kstart_eta_usec = 4 |
|
2438 kmax_rows = 5 |
|
2439 |
|
2440 _TEXT = _BuildTagLookupTable({ |
|
2441 0: "ErrorCode", |
|
2442 1: "app_id", |
|
2443 2: "queue_name", |
|
2444 3: "start_task_name", |
|
2445 4: "start_eta_usec", |
|
2446 5: "max_rows", |
|
2447 }, 5) |
|
2448 |
|
2449 _TYPES = _BuildTagLookupTable({ |
|
2450 0: ProtocolBuffer.Encoder.NUMERIC, |
|
2451 1: ProtocolBuffer.Encoder.STRING, |
|
2452 2: ProtocolBuffer.Encoder.STRING, |
|
2453 3: ProtocolBuffer.Encoder.STRING, |
|
2454 4: ProtocolBuffer.Encoder.NUMERIC, |
|
2455 5: ProtocolBuffer.Encoder.NUMERIC, |
|
2456 }, 5, ProtocolBuffer.Encoder.MAX_TYPE) |
|
2457 |
|
2458 _STYLE = """""" |
|
2459 _STYLE_CONTENT_TYPE = """""" |
|
2460 class TaskQueueQueryTasksResponse_TaskHeader(ProtocolBuffer.ProtocolMessage): |
|
2461 has_key_ = 0 |
|
2462 key_ = "" |
|
2463 has_value_ = 0 |
|
2464 value_ = "" |
|
2465 |
|
2466 def __init__(self, contents=None): |
|
2467 if contents is not None: self.MergeFromString(contents) |
|
2468 |
|
2469 def key(self): return self.key_ |
|
2470 |
|
2471 def set_key(self, x): |
|
2472 self.has_key_ = 1 |
|
2473 self.key_ = x |
|
2474 |
|
2475 def clear_key(self): |
|
2476 if self.has_key_: |
|
2477 self.has_key_ = 0 |
|
2478 self.key_ = "" |
|
2479 |
|
2480 def has_key(self): return self.has_key_ |
|
2481 |
|
2482 def value(self): return self.value_ |
|
2483 |
|
2484 def set_value(self, x): |
|
2485 self.has_value_ = 1 |
|
2486 self.value_ = x |
|
2487 |
|
2488 def clear_value(self): |
|
2489 if self.has_value_: |
|
2490 self.has_value_ = 0 |
|
2491 self.value_ = "" |
|
2492 |
|
2493 def has_value(self): return self.has_value_ |
|
2494 |
|
2495 |
|
2496 def MergeFrom(self, x): |
|
2497 assert x is not self |
|
2498 if (x.has_key()): self.set_key(x.key()) |
|
2499 if (x.has_value()): self.set_value(x.value()) |
|
2500 |
|
2501 def Equals(self, x): |
|
2502 if x is self: return 1 |
|
2503 if self.has_key_ != x.has_key_: return 0 |
|
2504 if self.has_key_ and self.key_ != x.key_: return 0 |
|
2505 if self.has_value_ != x.has_value_: return 0 |
|
2506 if self.has_value_ and self.value_ != x.value_: return 0 |
|
2507 return 1 |
|
2508 |
|
2509 def IsInitialized(self, debug_strs=None): |
|
2510 initialized = 1 |
|
2511 if (not self.has_key_): |
|
2512 initialized = 0 |
|
2513 if debug_strs is not None: |
|
2514 debug_strs.append('Required field: key not set.') |
|
2515 if (not self.has_value_): |
|
2516 initialized = 0 |
|
2517 if debug_strs is not None: |
|
2518 debug_strs.append('Required field: value not set.') |
|
2519 return initialized |
|
2520 |
|
2521 def ByteSize(self): |
|
2522 n = 0 |
|
2523 n += self.lengthString(len(self.key_)) |
|
2524 n += self.lengthString(len(self.value_)) |
|
2525 return n + 2 |
|
2526 |
|
2527 def Clear(self): |
|
2528 self.clear_key() |
|
2529 self.clear_value() |
|
2530 |
|
2531 def OutputUnchecked(self, out): |
|
2532 out.putVarInt32(66) |
|
2533 out.putPrefixedString(self.key_) |
|
2534 out.putVarInt32(74) |
|
2535 out.putPrefixedString(self.value_) |
|
2536 |
|
2537 def TryMerge(self, d): |
|
2538 while 1: |
|
2539 tt = d.getVarInt32() |
|
2540 if tt == 60: break |
|
2541 if tt == 66: |
|
2542 self.set_key(d.getPrefixedString()) |
|
2543 continue |
|
2544 if tt == 74: |
|
2545 self.set_value(d.getPrefixedString()) |
|
2546 continue |
|
2547 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
2548 d.skipData(tt) |
|
2549 |
|
2550 |
|
2551 def __str__(self, prefix="", printElemNumber=0): |
|
2552 res="" |
|
2553 if self.has_key_: res+=prefix+("key: %s\n" % self.DebugFormatString(self.key_)) |
|
2554 if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatString(self.value_)) |
|
2555 return res |
|
2556 |
|
2557 class TaskQueueQueryTasksResponse_Task(ProtocolBuffer.ProtocolMessage): |
|
2558 |
|
2559 GET = 1 |
|
2560 POST = 2 |
|
2561 HEAD = 3 |
|
2562 PUT = 4 |
|
2563 DELETE = 5 |
|
2564 |
|
2565 _RequestMethod_NAMES = { |
|
2566 1: "GET", |
|
2567 2: "POST", |
|
2568 3: "HEAD", |
|
2569 4: "PUT", |
|
2570 5: "DELETE", |
|
2571 } |
|
2572 |
|
2573 def RequestMethod_Name(cls, x): return cls._RequestMethod_NAMES.get(x, "") |
|
2574 RequestMethod_Name = classmethod(RequestMethod_Name) |
|
2575 |
|
2576 has_task_name_ = 0 |
|
2577 task_name_ = "" |
|
2578 has_eta_usec_ = 0 |
|
2579 eta_usec_ = 0 |
|
2580 has_url_ = 0 |
|
2581 url_ = "" |
|
2582 has_method_ = 0 |
|
2583 method_ = 0 |
|
2584 has_retry_count_ = 0 |
|
2585 retry_count_ = 0 |
|
2586 has_body_size_ = 0 |
|
2587 body_size_ = 0 |
|
2588 has_body_ = 0 |
|
2589 body_ = "" |
|
2590 |
|
2591 def __init__(self, contents=None): |
|
2592 self.header_ = [] |
|
2593 if contents is not None: self.MergeFromString(contents) |
|
2594 |
|
2595 def task_name(self): return self.task_name_ |
|
2596 |
|
2597 def set_task_name(self, x): |
|
2598 self.has_task_name_ = 1 |
|
2599 self.task_name_ = x |
|
2600 |
|
2601 def clear_task_name(self): |
|
2602 if self.has_task_name_: |
|
2603 self.has_task_name_ = 0 |
|
2604 self.task_name_ = "" |
|
2605 |
|
2606 def has_task_name(self): return self.has_task_name_ |
|
2607 |
|
2608 def eta_usec(self): return self.eta_usec_ |
|
2609 |
|
2610 def set_eta_usec(self, x): |
|
2611 self.has_eta_usec_ = 1 |
|
2612 self.eta_usec_ = x |
|
2613 |
|
2614 def clear_eta_usec(self): |
|
2615 if self.has_eta_usec_: |
|
2616 self.has_eta_usec_ = 0 |
|
2617 self.eta_usec_ = 0 |
|
2618 |
|
2619 def has_eta_usec(self): return self.has_eta_usec_ |
|
2620 |
|
2621 def url(self): return self.url_ |
|
2622 |
|
2623 def set_url(self, x): |
|
2624 self.has_url_ = 1 |
|
2625 self.url_ = x |
|
2626 |
|
2627 def clear_url(self): |
|
2628 if self.has_url_: |
|
2629 self.has_url_ = 0 |
|
2630 self.url_ = "" |
|
2631 |
|
2632 def has_url(self): return self.has_url_ |
|
2633 |
|
2634 def method(self): return self.method_ |
|
2635 |
|
2636 def set_method(self, x): |
|
2637 self.has_method_ = 1 |
|
2638 self.method_ = x |
|
2639 |
|
2640 def clear_method(self): |
|
2641 if self.has_method_: |
|
2642 self.has_method_ = 0 |
|
2643 self.method_ = 0 |
|
2644 |
|
2645 def has_method(self): return self.has_method_ |
|
2646 |
|
2647 def retry_count(self): return self.retry_count_ |
|
2648 |
|
2649 def set_retry_count(self, x): |
|
2650 self.has_retry_count_ = 1 |
|
2651 self.retry_count_ = x |
|
2652 |
|
2653 def clear_retry_count(self): |
|
2654 if self.has_retry_count_: |
|
2655 self.has_retry_count_ = 0 |
|
2656 self.retry_count_ = 0 |
|
2657 |
|
2658 def has_retry_count(self): return self.has_retry_count_ |
|
2659 |
|
2660 def header_size(self): return len(self.header_) |
|
2661 def header_list(self): return self.header_ |
|
2662 |
|
2663 def header(self, i): |
|
2664 return self.header_[i] |
|
2665 |
|
2666 def mutable_header(self, i): |
|
2667 return self.header_[i] |
|
2668 |
|
2669 def add_header(self): |
|
2670 x = TaskQueueQueryTasksResponse_TaskHeader() |
|
2671 self.header_.append(x) |
|
2672 return x |
|
2673 |
|
2674 def clear_header(self): |
|
2675 self.header_ = [] |
|
2676 def body_size(self): return self.body_size_ |
|
2677 |
|
2678 def set_body_size(self, x): |
|
2679 self.has_body_size_ = 1 |
|
2680 self.body_size_ = x |
|
2681 |
|
2682 def clear_body_size(self): |
|
2683 if self.has_body_size_: |
|
2684 self.has_body_size_ = 0 |
|
2685 self.body_size_ = 0 |
|
2686 |
|
2687 def has_body_size(self): return self.has_body_size_ |
|
2688 |
|
2689 def body(self): return self.body_ |
|
2690 |
|
2691 def set_body(self, x): |
|
2692 self.has_body_ = 1 |
|
2693 self.body_ = x |
|
2694 |
|
2695 def clear_body(self): |
|
2696 if self.has_body_: |
|
2697 self.has_body_ = 0 |
|
2698 self.body_ = "" |
|
2699 |
|
2700 def has_body(self): return self.has_body_ |
|
2701 |
|
2702 |
|
2703 def MergeFrom(self, x): |
|
2704 assert x is not self |
|
2705 if (x.has_task_name()): self.set_task_name(x.task_name()) |
|
2706 if (x.has_eta_usec()): self.set_eta_usec(x.eta_usec()) |
|
2707 if (x.has_url()): self.set_url(x.url()) |
|
2708 if (x.has_method()): self.set_method(x.method()) |
|
2709 if (x.has_retry_count()): self.set_retry_count(x.retry_count()) |
|
2710 for i in xrange(x.header_size()): self.add_header().CopyFrom(x.header(i)) |
|
2711 if (x.has_body_size()): self.set_body_size(x.body_size()) |
|
2712 if (x.has_body()): self.set_body(x.body()) |
|
2713 |
|
2714 def Equals(self, x): |
|
2715 if x is self: return 1 |
|
2716 if self.has_task_name_ != x.has_task_name_: return 0 |
|
2717 if self.has_task_name_ and self.task_name_ != x.task_name_: return 0 |
|
2718 if self.has_eta_usec_ != x.has_eta_usec_: return 0 |
|
2719 if self.has_eta_usec_ and self.eta_usec_ != x.eta_usec_: return 0 |
|
2720 if self.has_url_ != x.has_url_: return 0 |
|
2721 if self.has_url_ and self.url_ != x.url_: return 0 |
|
2722 if self.has_method_ != x.has_method_: return 0 |
|
2723 if self.has_method_ and self.method_ != x.method_: return 0 |
|
2724 if self.has_retry_count_ != x.has_retry_count_: return 0 |
|
2725 if self.has_retry_count_ and self.retry_count_ != x.retry_count_: return 0 |
|
2726 if len(self.header_) != len(x.header_): return 0 |
|
2727 for e1, e2 in zip(self.header_, x.header_): |
|
2728 if e1 != e2: return 0 |
|
2729 if self.has_body_size_ != x.has_body_size_: return 0 |
|
2730 if self.has_body_size_ and self.body_size_ != x.body_size_: return 0 |
|
2731 if self.has_body_ != x.has_body_: return 0 |
|
2732 if self.has_body_ and self.body_ != x.body_: return 0 |
|
2733 return 1 |
|
2734 |
|
2735 def IsInitialized(self, debug_strs=None): |
|
2736 initialized = 1 |
|
2737 if (not self.has_task_name_): |
|
2738 initialized = 0 |
|
2739 if debug_strs is not None: |
|
2740 debug_strs.append('Required field: task_name not set.') |
|
2741 if (not self.has_eta_usec_): |
|
2742 initialized = 0 |
|
2743 if debug_strs is not None: |
|
2744 debug_strs.append('Required field: eta_usec not set.') |
|
2745 if (not self.has_url_): |
|
2746 initialized = 0 |
|
2747 if debug_strs is not None: |
|
2748 debug_strs.append('Required field: url not set.') |
|
2749 if (not self.has_method_): |
|
2750 initialized = 0 |
|
2751 if debug_strs is not None: |
|
2752 debug_strs.append('Required field: method not set.') |
|
2753 for p in self.header_: |
|
2754 if not p.IsInitialized(debug_strs): initialized=0 |
|
2755 return initialized |
|
2756 |
|
2757 def ByteSize(self): |
|
2758 n = 0 |
|
2759 n += self.lengthString(len(self.task_name_)) |
|
2760 n += self.lengthVarInt64(self.eta_usec_) |
|
2761 n += self.lengthString(len(self.url_)) |
|
2762 n += self.lengthVarInt64(self.method_) |
|
2763 if (self.has_retry_count_): n += 1 + self.lengthVarInt64(self.retry_count_) |
|
2764 n += 2 * len(self.header_) |
|
2765 for i in xrange(len(self.header_)): n += self.header_[i].ByteSize() |
|
2766 if (self.has_body_size_): n += 1 + self.lengthVarInt64(self.body_size_) |
|
2767 if (self.has_body_): n += 1 + self.lengthString(len(self.body_)) |
|
2768 return n + 4 |
|
2769 |
|
2770 def Clear(self): |
|
2771 self.clear_task_name() |
|
2772 self.clear_eta_usec() |
|
2773 self.clear_url() |
|
2774 self.clear_method() |
|
2775 self.clear_retry_count() |
|
2776 self.clear_header() |
|
2777 self.clear_body_size() |
|
2778 self.clear_body() |
|
2779 |
|
2780 def OutputUnchecked(self, out): |
|
2781 out.putVarInt32(18) |
|
2782 out.putPrefixedString(self.task_name_) |
|
2783 out.putVarInt32(24) |
|
2784 out.putVarInt64(self.eta_usec_) |
|
2785 out.putVarInt32(34) |
|
2786 out.putPrefixedString(self.url_) |
|
2787 out.putVarInt32(40) |
|
2788 out.putVarInt32(self.method_) |
|
2789 if (self.has_retry_count_): |
|
2790 out.putVarInt32(48) |
|
2791 out.putVarInt32(self.retry_count_) |
|
2792 for i in xrange(len(self.header_)): |
|
2793 out.putVarInt32(59) |
|
2794 self.header_[i].OutputUnchecked(out) |
|
2795 out.putVarInt32(60) |
|
2796 if (self.has_body_size_): |
|
2797 out.putVarInt32(80) |
|
2798 out.putVarInt32(self.body_size_) |
|
2799 if (self.has_body_): |
|
2800 out.putVarInt32(90) |
|
2801 out.putPrefixedString(self.body_) |
|
2802 |
|
2803 def TryMerge(self, d): |
|
2804 while 1: |
|
2805 tt = d.getVarInt32() |
|
2806 if tt == 12: break |
|
2807 if tt == 18: |
|
2808 self.set_task_name(d.getPrefixedString()) |
|
2809 continue |
|
2810 if tt == 24: |
|
2811 self.set_eta_usec(d.getVarInt64()) |
|
2812 continue |
|
2813 if tt == 34: |
|
2814 self.set_url(d.getPrefixedString()) |
|
2815 continue |
|
2816 if tt == 40: |
|
2817 self.set_method(d.getVarInt32()) |
|
2818 continue |
|
2819 if tt == 48: |
|
2820 self.set_retry_count(d.getVarInt32()) |
|
2821 continue |
|
2822 if tt == 59: |
|
2823 self.add_header().TryMerge(d) |
|
2824 continue |
|
2825 if tt == 80: |
|
2826 self.set_body_size(d.getVarInt32()) |
|
2827 continue |
|
2828 if tt == 90: |
|
2829 self.set_body(d.getPrefixedString()) |
|
2830 continue |
|
2831 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
2832 d.skipData(tt) |
|
2833 |
|
2834 |
|
2835 def __str__(self, prefix="", printElemNumber=0): |
|
2836 res="" |
|
2837 if self.has_task_name_: res+=prefix+("task_name: %s\n" % self.DebugFormatString(self.task_name_)) |
|
2838 if self.has_eta_usec_: res+=prefix+("eta_usec: %s\n" % self.DebugFormatInt64(self.eta_usec_)) |
|
2839 if self.has_url_: res+=prefix+("url: %s\n" % self.DebugFormatString(self.url_)) |
|
2840 if self.has_method_: res+=prefix+("method: %s\n" % self.DebugFormatInt32(self.method_)) |
|
2841 if self.has_retry_count_: res+=prefix+("retry_count: %s\n" % self.DebugFormatInt32(self.retry_count_)) |
|
2842 cnt=0 |
|
2843 for e in self.header_: |
|
2844 elm="" |
|
2845 if printElemNumber: elm="(%d)" % cnt |
|
2846 res+=prefix+("Header%s {\n" % elm) |
|
2847 res+=e.__str__(prefix + " ", printElemNumber) |
|
2848 res+=prefix+"}\n" |
|
2849 cnt+=1 |
|
2850 if self.has_body_size_: res+=prefix+("body_size: %s\n" % self.DebugFormatInt32(self.body_size_)) |
|
2851 if self.has_body_: res+=prefix+("body: %s\n" % self.DebugFormatString(self.body_)) |
|
2852 return res |
|
2853 |
|
2854 class TaskQueueQueryTasksResponse(ProtocolBuffer.ProtocolMessage): |
|
2855 |
|
2856 def __init__(self, contents=None): |
|
2857 self.task_ = [] |
|
2858 if contents is not None: self.MergeFromString(contents) |
|
2859 |
|
2860 def task_size(self): return len(self.task_) |
|
2861 def task_list(self): return self.task_ |
|
2862 |
|
2863 def task(self, i): |
|
2864 return self.task_[i] |
|
2865 |
|
2866 def mutable_task(self, i): |
|
2867 return self.task_[i] |
|
2868 |
|
2869 def add_task(self): |
|
2870 x = TaskQueueQueryTasksResponse_Task() |
|
2871 self.task_.append(x) |
|
2872 return x |
|
2873 |
|
2874 def clear_task(self): |
|
2875 self.task_ = [] |
|
2876 |
|
2877 def MergeFrom(self, x): |
|
2878 assert x is not self |
|
2879 for i in xrange(x.task_size()): self.add_task().CopyFrom(x.task(i)) |
|
2880 |
|
2881 def Equals(self, x): |
|
2882 if x is self: return 1 |
|
2883 if len(self.task_) != len(x.task_): return 0 |
|
2884 for e1, e2 in zip(self.task_, x.task_): |
|
2885 if e1 != e2: return 0 |
|
2886 return 1 |
|
2887 |
|
2888 def IsInitialized(self, debug_strs=None): |
|
2889 initialized = 1 |
|
2890 for p in self.task_: |
|
2891 if not p.IsInitialized(debug_strs): initialized=0 |
|
2892 return initialized |
|
2893 |
|
2894 def ByteSize(self): |
|
2895 n = 0 |
|
2896 n += 2 * len(self.task_) |
|
2897 for i in xrange(len(self.task_)): n += self.task_[i].ByteSize() |
|
2898 return n + 0 |
|
2899 |
|
2900 def Clear(self): |
|
2901 self.clear_task() |
|
2902 |
|
2903 def OutputUnchecked(self, out): |
|
2904 for i in xrange(len(self.task_)): |
|
2905 out.putVarInt32(11) |
|
2906 self.task_[i].OutputUnchecked(out) |
|
2907 out.putVarInt32(12) |
|
2908 |
|
2909 def TryMerge(self, d): |
|
2910 while d.avail() > 0: |
|
2911 tt = d.getVarInt32() |
|
2912 if tt == 11: |
|
2913 self.add_task().TryMerge(d) |
|
2914 continue |
|
2915 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
2916 d.skipData(tt) |
|
2917 |
|
2918 |
|
2919 def __str__(self, prefix="", printElemNumber=0): |
|
2920 res="" |
|
2921 cnt=0 |
|
2922 for e in self.task_: |
|
2923 elm="" |
|
2924 if printElemNumber: elm="(%d)" % cnt |
|
2925 res+=prefix+("Task%s {\n" % elm) |
|
2926 res+=e.__str__(prefix + " ", printElemNumber) |
|
2927 res+=prefix+"}\n" |
|
2928 cnt+=1 |
|
2929 return res |
|
2930 |
|
2931 |
|
2932 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
2933 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
2934 |
|
2935 kTaskGroup = 1 |
|
2936 kTasktask_name = 2 |
|
2937 kTasketa_usec = 3 |
|
2938 kTaskurl = 4 |
|
2939 kTaskmethod = 5 |
|
2940 kTaskretry_count = 6 |
|
2941 kTaskHeaderGroup = 7 |
|
2942 kTaskHeaderkey = 8 |
|
2943 kTaskHeadervalue = 9 |
|
2944 kTaskbody_size = 10 |
|
2945 kTaskbody = 11 |
|
2946 |
|
2947 _TEXT = _BuildTagLookupTable({ |
|
2948 0: "ErrorCode", |
|
2949 1: "Task", |
|
2950 2: "task_name", |
|
2951 3: "eta_usec", |
|
2952 4: "url", |
|
2953 5: "method", |
|
2954 6: "retry_count", |
|
2955 7: "Header", |
|
2956 8: "key", |
|
2957 9: "value", |
|
2958 10: "body_size", |
|
2959 11: "body", |
|
2960 }, 11) |
|
2961 |
|
2962 _TYPES = _BuildTagLookupTable({ |
|
2963 0: ProtocolBuffer.Encoder.NUMERIC, |
|
2964 1: ProtocolBuffer.Encoder.STARTGROUP, |
|
2965 2: ProtocolBuffer.Encoder.STRING, |
|
2966 3: ProtocolBuffer.Encoder.NUMERIC, |
|
2967 4: ProtocolBuffer.Encoder.STRING, |
|
2968 5: ProtocolBuffer.Encoder.NUMERIC, |
|
2969 6: ProtocolBuffer.Encoder.NUMERIC, |
|
2970 7: ProtocolBuffer.Encoder.STARTGROUP, |
|
2971 8: ProtocolBuffer.Encoder.STRING, |
|
2972 9: ProtocolBuffer.Encoder.STRING, |
|
2973 10: ProtocolBuffer.Encoder.NUMERIC, |
|
2974 11: ProtocolBuffer.Encoder.STRING, |
|
2975 }, 11, ProtocolBuffer.Encoder.MAX_TYPE) |
|
2976 |
|
2977 _STYLE = """""" |
|
2978 _STYLE_CONTENT_TYPE = """""" |
|
2979 |
|
2980 __all__ = ['TaskQueueServiceError','TaskQueueAddRequest','TaskQueueAddRequest_Header','TaskQueueAddResponse','TaskQueueDeleteRequest','TaskQueueDeleteResponse','TaskQueueUpdateQueueRequest','TaskQueueUpdateQueueResponse','TaskQueueFetchQueuesRequest','TaskQueueFetchQueuesResponse','TaskQueueFetchQueuesResponse_Queue','TaskQueueFetchQueueStatsRequest','TaskQueueScannerQueueInfo','TaskQueueFetchQueueStatsResponse','TaskQueueFetchQueueStatsResponse_QueueStats','TaskQueueDeleteQueueRequest','TaskQueueDeleteQueueResponse','TaskQueueQueryTasksRequest','TaskQueueQueryTasksResponse','TaskQueueQueryTasksResponse_TaskHeader','TaskQueueQueryTasksResponse_Task'] |