/proto/market.proto.php
https://github.com/nidhinj/android-market-api-php · PHP · 1377 lines · 1249 code · 91 blank · 37 comment · 196 complexity · 14322b31ce756f96109ca314e2cba443 MD5 · raw file
- <?php
- // Please include the below file before market.proto.php
- //require('protocolbuffers.inc.php');
- // enum AppsRequest.OrderType
- class AppsRequest_OrderType {
- const NONE = 0;
- const POPULAR = 1;
- const NEWEST = 2;
- const FEATURED = 3;
-
- public static $_values = array(
- 0 => self::NONE,
- 1 => self::POPULAR,
- 2 => self::NEWEST,
- 3 => self::FEATURED,
- );
-
- public static function toString($value) {
- if (is_null($value)) return null;
- if (array_key_exists($value, self::$_values))
- return self::$_values[$value];
- return 'UNKNOWN';
- }
- }
- // enum AppsRequest.ViewType
- class AppsRequest_ViewType {
- const ALL = 0;
- const FREE = 1;
- const PAID = 2;
-
- public static $_values = array(
- 0 => self::ALL,
- 1 => self::FREE,
- 2 => self::PAID,
- );
-
- public static function toString($value) {
- if (is_null($value)) return null;
- if (array_key_exists($value, self::$_values))
- return self::$_values[$value];
- return 'UNKNOWN';
- }
- }
- // message AppsRequest
- class AppsRequest {
- private $_unknown;
-
- function __construct($in = NULL, &$limit = PHP_INT_MAX) {
- if($in !== NULL) {
- if (is_string($in)) {
- $fp = fopen('php://memory', 'r+b');
- fwrite($fp, $in);
- rewind($fp);
- } else if (is_resource($in)) {
- $fp = $in;
- } else {
- throw new Exception('Invalid in parameter');
- }
- $this->read($fp, $limit);
- }
- }
-
- function read($fp, &$limit = PHP_INT_MAX) {
- while(!feof($fp) && $limit > 0) {
- $tag = Protobuf::read_varint($fp, $limit);
- if ($tag === false) break;
- $wire = $tag & 0x07;
- $field = $tag >> 3;
- //var_dump("AppsRequest: Found $field type " . Protobuf::get_wiretype($wire) . " $limit bytes left");
- switch($field) {
- case 1:
- ASSERT('$wire == 0');
- $tmp = Protobuf::read_varint($fp, $limit);
- if ($tmp === false)
- throw new Exception('Protobuf::read_varint returned false');
- $this->appType_ = $tmp;
-
- break;
- case 2:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->query_ = $tmp;
- $limit-=$len;
- break;
- case 3:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->categoryId_ = $tmp;
- $limit-=$len;
- break;
- case 4:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->appId_ = $tmp;
- $limit-=$len;
- break;
- case 6:
- ASSERT('$wire == 0');
- $tmp = Protobuf::read_varint($fp, $limit);
- if ($tmp === false)
- throw new Exception('Protobuf::read_varint returned false');
- $this->withExtendedInfo_ = $tmp > 0 ? true : false;
- break;
- case 7:
- ASSERT('$wire == 0');
- $tmp = Protobuf::read_varint($fp, $limit);
- if ($tmp === false)
- throw new Exception('Protobuf::read_varint returned false');
- $this->orderType_ = $tmp;
-
- break;
- case 8:
- ASSERT('$wire == 0');
- $tmp = Protobuf::read_varint($fp, $limit);
- if ($tmp === false)
- throw new Exception('Protobuf::read_varint returned false');
- $this->startIndex_ = $tmp;
-
- break;
- case 9:
- ASSERT('$wire == 0');
- $tmp = Protobuf::read_varint($fp, $limit);
- if ($tmp === false)
- throw new Exception('Protobuf::read_varint returned false');
- $this->entriesCount_ = $tmp;
-
- break;
- case 10:
- ASSERT('$wire == 0');
- $tmp = Protobuf::read_varint($fp, $limit);
- if ($tmp === false)
- throw new Exception('Protobuf::read_varint returned false');
- $this->viewType_ = $tmp;
-
- break;
- default:
- $this->_unknown[$field . '-' . Protobuf::get_wiretype($wire)][] = Protobuf::read_field($fp, $wire, $limit);
- }
- }
- if (!$this->validateRequired())
- throw new Exception('Required fields are missing');
- }
-
- function write($fp) {
- if (!$this->validateRequired())
- throw new Exception('Required fields are missing');
- if (!is_null($this->appType_)) {
- fwrite($fp, "\x08");
- Protobuf::write_varint($fp, $this->appType_);
- }
- if (!is_null($this->query_)) {
- fwrite($fp, "\x12");
- Protobuf::write_varint($fp, strlen($this->query_));
- fwrite($fp, $this->query_);
- }
- if (!is_null($this->categoryId_)) {
- fwrite($fp, "\x1a");
- Protobuf::write_varint($fp, strlen($this->categoryId_));
- fwrite($fp, $this->categoryId_);
- }
- if (!is_null($this->appId_)) {
- fwrite($fp, "\"");
- Protobuf::write_varint($fp, strlen($this->appId_));
- fwrite($fp, $this->appId_);
- }
- if (!is_null($this->withExtendedInfo_)) {
- fwrite($fp, "0");
- Protobuf::write_varint($fp, $this->withExtendedInfo_ ? 1 : 0);
- }
- if (!is_null($this->orderType_)) {
- fwrite($fp, "8");
- Protobuf::write_varint($fp, $this->orderType_);
- }
- if (!is_null($this->startIndex_)) {
- fwrite($fp, "@");
- Protobuf::write_varint($fp, $this->startIndex_);
- }
- if (!is_null($this->entriesCount_)) {
- fwrite($fp, "H");
- Protobuf::write_varint($fp, $this->entriesCount_);
- }
- if (!is_null($this->viewType_)) {
- fwrite($fp, "P");
- Protobuf::write_varint($fp, $this->viewType_);
- }
- }
-
- public function size() {
- $size = 0;
- if (!is_null($this->appType_)) {
- $size += 1 + Protobuf::size_varint($this->appType_);
- }
- if (!is_null($this->query_)) {
- $l = strlen($this->query_);
- $size += 1 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->categoryId_)) {
- $l = strlen($this->categoryId_);
- $size += 1 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->appId_)) {
- $l = strlen($this->appId_);
- $size += 1 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->withExtendedInfo_)) {
- $size += 2;
- }
- if (!is_null($this->orderType_)) {
- $size += 1 + Protobuf::size_varint($this->orderType_);
- }
- if (!is_null($this->startIndex_)) {
- $size += 1 + Protobuf::size_varint($this->startIndex_);
- }
- if (!is_null($this->entriesCount_)) {
- $size += 1 + Protobuf::size_varint($this->entriesCount_);
- }
- if (!is_null($this->viewType_)) {
- $size += 1 + Protobuf::size_varint($this->viewType_);
- }
- return $size;
- }
-
- public function validateRequired() {
- return true;
- }
-
- public function __toString() {
- return ''
- . Protobuf::toString('unknown', $this->_unknown)
- . Protobuf::toString('appType_', AppType::toString($this->appType_))
- . Protobuf::toString('query_', $this->query_)
- . Protobuf::toString('categoryId_', $this->categoryId_)
- . Protobuf::toString('appId_', $this->appId_)
- . Protobuf::toString('withExtendedInfo_', $this->withExtendedInfo_)
- . Protobuf::toString('orderType_', AppsRequest_OrderType::toString($this->orderType_))
- . Protobuf::toString('startIndex_', $this->startIndex_)
- . Protobuf::toString('entriesCount_', $this->entriesCount_)
- . Protobuf::toString('viewType_', AppsRequest_ViewType::toString($this->viewType_));
- }
-
- // optional .AppType appType = 1;
- private $appType_ = null;
- public function clearAppType() { $this->appType_ = null; }
- public function hasAppType() { return $this->appType_ !== null; }
- public function getAppType() { if($this->appType_ === null) return AppType::NONE; else return $this->appType_; }
- public function setAppType($value) { $this->appType_ = $value; }
-
- // optional string query = 2;
- private $query_ = null;
- public function clearQuery() { $this->query_ = null; }
- public function hasQuery() { return $this->query_ !== null; }
- public function getQuery() { if($this->query_ === null) return ""; else return $this->query_; }
- public function setQuery($value) { $this->query_ = $value; }
-
- // optional string categoryId = 3;
- private $categoryId_ = null;
- public function clearCategoryId() { $this->categoryId_ = null; }
- public function hasCategoryId() { return $this->categoryId_ !== null; }
- public function getCategoryId() { if($this->categoryId_ === null) return ""; else return $this->categoryId_; }
- public function setCategoryId($value) { $this->categoryId_ = $value; }
-
- // optional string appId = 4;
- private $appId_ = null;
- public function clearAppId() { $this->appId_ = null; }
- public function hasAppId() { return $this->appId_ !== null; }
- public function getAppId() { if($this->appId_ === null) return ""; else return $this->appId_; }
- public function setAppId($value) { $this->appId_ = $value; }
-
- // optional bool withExtendedInfo = 6;
- private $withExtendedInfo_ = null;
- public function clearWithExtendedInfo() { $this->withExtendedInfo_ = null; }
- public function hasWithExtendedInfo() { return $this->withExtendedInfo_ !== null; }
- public function getWithExtendedInfo() { if($this->withExtendedInfo_ === null) return false; else return $this->withExtendedInfo_; }
- public function setWithExtendedInfo($value) { $this->withExtendedInfo_ = $value; }
-
- // optional .AppsRequest.OrderType orderType = 7 [default = NONE];
- private $orderType_ = null;
- public function clearOrderType() { $this->orderType_ = null; }
- public function hasOrderType() { return $this->orderType_ !== null; }
- public function getOrderType() { if($this->orderType_ === null) return AppsRequest_OrderType::NONE; else return $this->orderType_; }
- public function setOrderType($value) { $this->orderType_ = $value; }
-
- // optional uint64 startIndex = 8;
- private $startIndex_ = null;
- public function clearStartIndex() { $this->startIndex_ = null; }
- public function hasStartIndex() { return $this->startIndex_ !== null; }
- public function getStartIndex() { if($this->startIndex_ === null) return 0; else return $this->startIndex_; }
- public function setStartIndex($value) { $this->startIndex_ = $value; }
-
- // optional int32 entriesCount = 9;
- private $entriesCount_ = null;
- public function clearEntriesCount() { $this->entriesCount_ = null; }
- public function hasEntriesCount() { return $this->entriesCount_ !== null; }
- public function getEntriesCount() { if($this->entriesCount_ === null) return 0; else return $this->entriesCount_; }
- public function setEntriesCount($value) { $this->entriesCount_ = $value; }
-
- // optional .AppsRequest.ViewType viewType = 10 [default = ALL];
- private $viewType_ = null;
- public function clearViewType() { $this->viewType_ = null; }
- public function hasViewType() { return $this->viewType_ !== null; }
- public function getViewType() { if($this->viewType_ === null) return AppsRequest_ViewType::ALL; else return $this->viewType_; }
- public function setViewType($value) { $this->viewType_ = $value; }
-
- // @@protoc_insertion_point(class_scope:AppsRequest)
- }
- // message AppsResponse
- class AppsResponse {
- private $_unknown;
-
- function __construct($in = NULL, &$limit = PHP_INT_MAX) {
- if($in !== NULL) {
- if (is_string($in)) {
- $fp = fopen('php://memory', 'r+b');
- fwrite($fp, $in);
- rewind($fp);
- } else if (is_resource($in)) {
- $fp = $in;
- } else {
- throw new Exception('Invalid in parameter');
- }
- $this->read($fp, $limit);
- }
- }
-
- function read($fp, &$limit = PHP_INT_MAX) {
- while(!feof($fp) && $limit > 0) {
- $tag = Protobuf::read_varint($fp, $limit);
- if ($tag === false) break;
- $wire = $tag & 0x07;
- $field = $tag >> 3;
- //var_dump("AppsResponse: Found $field type " . Protobuf::get_wiretype($wire) . " $limit bytes left");
- switch($field) {
- case 1:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- $limit-=$len;
- $this->app_[] = new App($fp, $len);
- ASSERT('$len == 0');
- break;
- case 2:
- ASSERT('$wire == 0');
- $tmp = Protobuf::read_varint($fp, $limit);
- if ($tmp === false)
- throw new Exception('Protobuf::read_varint returned false');
- $this->entriesCount_ = $tmp;
-
- break;
- default:
- $this->_unknown[$field . '-' . Protobuf::get_wiretype($wire)][] = Protobuf::read_field($fp, $wire, $limit);
- }
- }
- if (!$this->validateRequired())
- throw new Exception('Required fields are missing');
- }
-
- function write($fp) {
- if (!$this->validateRequired())
- throw new Exception('Required fields are missing');
- if (!is_null($this->app_))
- foreach($this->app_ as $v) {
- fwrite($fp, "\x0a");
- Protobuf::write_varint($fp, $v->size()); // message
- $v->write($fp);
- }
- if (!is_null($this->entriesCount_)) {
- fwrite($fp, "\x10");
- Protobuf::write_varint($fp, $this->entriesCount_);
- }
- }
-
- public function size() {
- $size = 0;
- if (!is_null($this->app_))
- foreach($this->app_ as $v) {
- $l = $v->size();
- $size += 1 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->entriesCount_)) {
- $size += 1 + Protobuf::size_varint($this->entriesCount_);
- }
- return $size;
- }
-
- public function validateRequired() {
- return true;
- }
-
- public function __toString() {
- return ''
- . Protobuf::toString('unknown', $this->_unknown)
- . Protobuf::toString('app_', $this->app_)
- . Protobuf::toString('entriesCount_', $this->entriesCount_);
- }
-
- // repeated .App app = 1;
- private $app_ = null;
- public function clearApp() { $this->app_ = null; }
- public function getAppCount() { if ($this->app_ === null ) return 0; else return count($this->app_); }
- public function getApp($index) { return $this->app_[$index]; }
- public function getAppArray() { if ($this->app_ === null ) return array(); else return $this->app_; }
- public function setApp($index, $value) {$this->app_[$index] = $value; }
- public function addApp($value) { $this->app_[] = $value; }
- public function addAllApp(array $values) { foreach($values as $value) {$this->app_[] = $value;} }
-
- // optional int32 entriesCount = 2;
- private $entriesCount_ = null;
- public function clearEntriesCount() { $this->entriesCount_ = null; }
- public function hasEntriesCount() { return $this->entriesCount_ !== null; }
- public function getEntriesCount() { if($this->entriesCount_ === null) return 0; else return $this->entriesCount_; }
- public function setEntriesCount($value) { $this->entriesCount_ = $value; }
-
- // @@protoc_insertion_point(class_scope:AppsResponse)
- }
- // message Category
- class Category {
- private $_unknown;
-
- function __construct($in = NULL, &$limit = PHP_INT_MAX) {
- if($in !== NULL) {
- if (is_string($in)) {
- $fp = fopen('php://memory', 'r+b');
- fwrite($fp, $in);
- rewind($fp);
- } else if (is_resource($in)) {
- $fp = $in;
- } else {
- throw new Exception('Invalid in parameter');
- }
- $this->read($fp, $limit);
- }
- }
-
- function read($fp, &$limit = PHP_INT_MAX) {
- while(!feof($fp) && $limit > 0) {
- $tag = Protobuf::read_varint($fp, $limit);
- if ($tag === false) break;
- $wire = $tag & 0x07;
- $field = $tag >> 3;
- //var_dump("Category: Found $field type " . Protobuf::get_wiretype($wire) . " $limit bytes left");
- switch($field) {
- case 2:
- ASSERT('$wire == 0');
- $tmp = Protobuf::read_varint($fp, $limit);
- if ($tmp === false)
- throw new Exception('Protobuf::read_varint returned false');
- $this->appType_ = $tmp;
-
- break;
- case 4:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->title_ = $tmp;
- $limit-=$len;
- break;
- case 3:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->categoryId_ = $tmp;
- $limit-=$len;
- break;
- case 5:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->subtitle_ = $tmp;
- $limit-=$len;
- break;
- case 8:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- $limit-=$len;
- $this->subCategories_[] = new Category($fp, $len);
- ASSERT('$len == 0');
- break;
- default:
- $this->_unknown[$field . '-' . Protobuf::get_wiretype($wire)][] = Protobuf::read_field($fp, $wire, $limit);
- }
- }
- if (!$this->validateRequired())
- throw new Exception('Required fields are missing');
- }
-
- function write($fp) {
- if (!$this->validateRequired())
- throw new Exception('Required fields are missing');
- if (!is_null($this->appType_)) {
- fwrite($fp, "\x10");
- Protobuf::write_varint($fp, $this->appType_);
- }
- if (!is_null($this->title_)) {
- fwrite($fp, "\"");
- Protobuf::write_varint($fp, strlen($this->title_));
- fwrite($fp, $this->title_);
- }
- if (!is_null($this->categoryId_)) {
- fwrite($fp, "\x1a");
- Protobuf::write_varint($fp, strlen($this->categoryId_));
- fwrite($fp, $this->categoryId_);
- }
- if (!is_null($this->subtitle_)) {
- fwrite($fp, "*");
- Protobuf::write_varint($fp, strlen($this->subtitle_));
- fwrite($fp, $this->subtitle_);
- }
- if (!is_null($this->subCategories_))
- foreach($this->subCategories_ as $v) {
- fwrite($fp, "B");
- Protobuf::write_varint($fp, $v->size()); // message
- $v->write($fp);
- }
- }
-
- public function size() {
- $size = 0;
- if (!is_null($this->appType_)) {
- $size += 1 + Protobuf::size_varint($this->appType_);
- }
- if (!is_null($this->title_)) {
- $l = strlen($this->title_);
- $size += 1 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->categoryId_)) {
- $l = strlen($this->categoryId_);
- $size += 1 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->subtitle_)) {
- $l = strlen($this->subtitle_);
- $size += 1 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->subCategories_))
- foreach($this->subCategories_ as $v) {
- $l = $v->size();
- $size += 1 + Protobuf::size_varint($l) + $l;
- }
- return $size;
- }
-
- public function validateRequired() {
- return true;
- }
-
- public function __toString() {
- return ''
- . Protobuf::toString('unknown', $this->_unknown)
- . Protobuf::toString('appType_', $this->appType_)
- . Protobuf::toString('title_', $this->title_)
- . Protobuf::toString('categoryId_', $this->categoryId_)
- . Protobuf::toString('subtitle_', $this->subtitle_)
- . Protobuf::toString('subCategories_', $this->subCategories_);
- }
-
- // optional int32 appType = 2;
- private $appType_ = null;
- public function clearAppType() { $this->appType_ = null; }
- public function hasAppType() { return $this->appType_ !== null; }
- public function getAppType() { if($this->appType_ === null) return 0; else return $this->appType_; }
- public function setAppType($value) { $this->appType_ = $value; }
-
- // optional string title = 4;
- private $title_ = null;
- public function clearTitle() { $this->title_ = null; }
- public function hasTitle() { return $this->title_ !== null; }
- public function getTitle() { if($this->title_ === null) return ""; else return $this->title_; }
- public function setTitle($value) { $this->title_ = $value; }
-
- // optional string categoryId = 3;
- private $categoryId_ = null;
- public function clearCategoryId() { $this->categoryId_ = null; }
- public function hasCategoryId() { return $this->categoryId_ !== null; }
- public function getCategoryId() { if($this->categoryId_ === null) return ""; else return $this->categoryId_; }
- public function setCategoryId($value) { $this->categoryId_ = $value; }
-
- // optional string subtitle = 5;
- private $subtitle_ = null;
- public function clearSubtitle() { $this->subtitle_ = null; }
- public function hasSubtitle() { return $this->subtitle_ !== null; }
- public function getSubtitle() { if($this->subtitle_ === null) return ""; else return $this->subtitle_; }
- public function setSubtitle($value) { $this->subtitle_ = $value; }
-
- // repeated .Category subCategories = 8;
- private $subCategories_ = null;
- public function clearSubCategories() { $this->subCategories_ = null; }
- public function getSubCategoriesCount() { if ($this->subCategories_ === null ) return 0; else return count($this->subCategories_); }
- public function getSubCategories($index) { return $this->subCategories_[$index]; }
- public function getSubCategoriesArray() { if ($this->subCategories_ === null ) return array(); else return $this->subCategories_; }
- public function setSubCategories($index, $value) {$this->subCategories_[$index] = $value; }
- public function addSubCategories($value) { $this->subCategories_[] = $value; }
- public function addAllSubCategories(array $values) { foreach($values as $value) {$this->subCategories_[] = $value;} }
-
- // @@protoc_insertion_point(class_scope:Category)
- }
- // message CommentsRequest
- class CommentsRequest {
- private $_unknown;
-
- function __construct($in = NULL, &$limit = PHP_INT_MAX) {
- if($in !== NULL) {
- if (is_string($in)) {
- $fp = fopen('php://memory', 'r+b');
- fwrite($fp, $in);
- rewind($fp);
- } else if (is_resource($in)) {
- $fp = $in;
- } else {
- throw new Exception('Invalid in parameter');
- }
- $this->read($fp, $limit);
- }
- }
-
- function read($fp, &$limit = PHP_INT_MAX) {
- while(!feof($fp) && $limit > 0) {
- $tag = Protobuf::read_varint($fp, $limit);
- if ($tag === false) break;
- $wire = $tag & 0x07;
- $field = $tag >> 3;
- //var_dump("CommentsRequest: Found $field type " . Protobuf::get_wiretype($wire) . " $limit bytes left");
- switch($field) {
- case 1:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->appId_ = $tmp;
- $limit-=$len;
- break;
- case 2:
- ASSERT('$wire == 0');
- $tmp = Protobuf::read_varint($fp, $limit);
- if ($tmp === false)
- throw new Exception('Protobuf::read_varint returned false');
- $this->startIndex_ = $tmp;
-
- break;
- case 3:
- ASSERT('$wire == 0');
- $tmp = Protobuf::read_varint($fp, $limit);
- if ($tmp === false)
- throw new Exception('Protobuf::read_varint returned false');
- $this->entriesCount_ = $tmp;
-
- break;
- default:
- $this->_unknown[$field . '-' . Protobuf::get_wiretype($wire)][] = Protobuf::read_field($fp, $wire, $limit);
- }
- }
- if (!$this->validateRequired())
- throw new Exception('Required fields are missing');
- }
-
- function write($fp) {
- if (!$this->validateRequired())
- throw new Exception('Required fields are missing');
- if (!is_null($this->appId_)) {
- fwrite($fp, "\x0a");
- Protobuf::write_varint($fp, strlen($this->appId_));
- fwrite($fp, $this->appId_);
- }
- if (!is_null($this->startIndex_)) {
- fwrite($fp, "\x10");
- Protobuf::write_varint($fp, $this->startIndex_);
- }
- if (!is_null($this->entriesCount_)) {
- fwrite($fp, "\x18");
- Protobuf::write_varint($fp, $this->entriesCount_);
- }
- }
-
- public function size() {
- $size = 0;
- if (!is_null($this->appId_)) {
- $l = strlen($this->appId_);
- $size += 1 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->startIndex_)) {
- $size += 1 + Protobuf::size_varint($this->startIndex_);
- }
- if (!is_null($this->entriesCount_)) {
- $size += 1 + Protobuf::size_varint($this->entriesCount_);
- }
- return $size;
- }
-
- public function validateRequired() {
- return true;
- }
-
- public function __toString() {
- return ''
- . Protobuf::toString('unknown', $this->_unknown)
- . Protobuf::toString('appId_', $this->appId_)
- . Protobuf::toString('startIndex_', $this->startIndex_)
- . Protobuf::toString('entriesCount_', $this->entriesCount_);
- }
-
- // optional string appId = 1;
- private $appId_ = null;
- public function clearAppId() { $this->appId_ = null; }
- public function hasAppId() { return $this->appId_ !== null; }
- public function getAppId() { if($this->appId_ === null) return ""; else return $this->appId_; }
- public function setAppId($value) { $this->appId_ = $value; }
-
- // optional int32 startIndex = 2;
- private $startIndex_ = null;
- public function clearStartIndex() { $this->startIndex_ = null; }
- public function hasStartIndex() { return $this->startIndex_ !== null; }
- public function getStartIndex() { if($this->startIndex_ === null) return 0; else return $this->startIndex_; }
- public function setStartIndex($value) { $this->startIndex_ = $value; }
-
- // optional int32 entriesCount = 3;
- private $entriesCount_ = null;
- public function clearEntriesCount() { $this->entriesCount_ = null; }
- public function hasEntriesCount() { return $this->entriesCount_ !== null; }
- public function getEntriesCount() { if($this->entriesCount_ === null) return 0; else return $this->entriesCount_; }
- public function setEntriesCount($value) { $this->entriesCount_ = $value; }
-
- // @@protoc_insertion_point(class_scope:CommentsRequest)
- }
- // message CommentsResponse
- class CommentsResponse {
- private $_unknown;
-
- function __construct($in = NULL, &$limit = PHP_INT_MAX) {
- if($in !== NULL) {
- if (is_string($in)) {
- $fp = fopen('php://memory', 'r+b');
- fwrite($fp, $in);
- rewind($fp);
- } else if (is_resource($in)) {
- $fp = $in;
- } else {
- throw new Exception('Invalid in parameter');
- }
- $this->read($fp, $limit);
- }
- }
-
- function read($fp, &$limit = PHP_INT_MAX) {
- while(!feof($fp) && $limit > 0) {
- $tag = Protobuf::read_varint($fp, $limit);
- if ($tag === false) break;
- $wire = $tag & 0x07;
- $field = $tag >> 3;
- //var_dump("CommentsResponse: Found $field type " . Protobuf::get_wiretype($wire) . " $limit bytes left");
- switch($field) {
- case 1:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- $limit-=$len;
- $this->comments_[] = new Comment($fp, $len);
- ASSERT('$len == 0');
- break;
- case 2:
- ASSERT('$wire == 0');
- $tmp = Protobuf::read_varint($fp, $limit);
- if ($tmp === false)
- throw new Exception('Protobuf::read_varint returned false');
- $this->entriesCount_ = $tmp;
-
- break;
- default:
- $this->_unknown[$field . '-' . Protobuf::get_wiretype($wire)][] = Protobuf::read_field($fp, $wire, $limit);
- }
- }
- if (!$this->validateRequired())
- throw new Exception('Required fields are missing');
- }
-
- function write($fp) {
- if (!$this->validateRequired())
- throw new Exception('Required fields are missing');
- if (!is_null($this->comments_))
- foreach($this->comments_ as $v) {
- fwrite($fp, "\x0a");
- Protobuf::write_varint($fp, $v->size()); // message
- $v->write($fp);
- }
- if (!is_null($this->entriesCount_)) {
- fwrite($fp, "\x10");
- Protobuf::write_varint($fp, $this->entriesCount_);
- }
- }
-
- public function size() {
- $size = 0;
- if (!is_null($this->comments_))
- foreach($this->comments_ as $v) {
- $l = $v->size();
- $size += 1 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->entriesCount_)) {
- $size += 1 + Protobuf::size_varint($this->entriesCount_);
- }
- return $size;
- }
-
- public function validateRequired() {
- return true;
- }
-
- public function __toString() {
- return ''
- . Protobuf::toString('unknown', $this->_unknown)
- . Protobuf::toString('comments_', $this->comments_)
- . Protobuf::toString('entriesCount_', $this->entriesCount_);
- }
-
- // repeated .Comment comments = 1;
- private $comments_ = null;
- public function clearComments() { $this->comments_ = null; }
- public function getCommentsCount() { if ($this->comments_ === null ) return 0; else return count($this->comments_); }
- public function getComments($index) { return $this->comments_[$index]; }
- public function getCommentsArray() { if ($this->comments_ === null ) return array(); else return $this->comments_; }
- public function setComments($index, $value) {$this->comments_[$index] = $value; }
- public function addComments($value) { $this->comments_[] = $value; }
- public function addAllComments(array $values) { foreach($values as $value) {$this->comments_[] = $value;} }
-
- // optional int32 entriesCount = 2;
- private $entriesCount_ = null;
- public function clearEntriesCount() { $this->entriesCount_ = null; }
- public function hasEntriesCount() { return $this->entriesCount_ !== null; }
- public function getEntriesCount() { if($this->entriesCount_ === null) return 0; else return $this->entriesCount_; }
- public function setEntriesCount($value) { $this->entriesCount_ = $value; }
-
- // @@protoc_insertion_point(class_scope:CommentsResponse)
- }
- // group App.ExtendedInfo
- class App_ExtendedInfo {
- private $_unknown;
-
- function __construct($in = NULL, &$limit = PHP_INT_MAX) {
- if($in !== NULL) {
- if (is_string($in)) {
- $fp = fopen('php://memory', 'r+b');
- fwrite($fp, $in);
- rewind($fp);
- } else if (is_resource($in)) {
- $fp = $in;
- } else {
- throw new Exception('Invalid in parameter');
- }
- $this->read($fp, $limit);
- }
- }
-
- function read($fp, &$limit = PHP_INT_MAX) {
- while(!feof($fp) && $limit > 0) {
- $tag = Protobuf::read_varint($fp, $limit);
- if ($tag === false) break;
- $wire = $tag & 0x07;
- $field = $tag >> 3;
- //var_dump("App_ExtendedInfo: Found $field type " . Protobuf::get_wiretype($wire) . " $limit bytes left");
- switch($field) {
- case 12:
- ASSERT('$wire == 4');
- break 2;
- case 13:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->description_ = $tmp;
- $limit-=$len;
- break;
- case 14:
- ASSERT('$wire == 0');
- $tmp = Protobuf::read_varint($fp, $limit);
- if ($tmp === false)
- throw new Exception('Protobuf::read_varint returned false');
- $this->downloadsCount_ = $tmp;
-
- break;
- case 15:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->permissionId_[] = $tmp;
- $limit-=$len;
- break;
- case 16:
- ASSERT('$wire == 0');
- $tmp = Protobuf::read_varint($fp, $limit);
- if ($tmp === false)
- throw new Exception('Protobuf::read_varint returned false');
- $this->installSize_ = $tmp;
-
- break;
- case 17:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->packageName_ = $tmp;
- $limit-=$len;
- break;
- case 18:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->category_ = $tmp;
- $limit-=$len;
- break;
- case 20:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->contactEmail_ = $tmp;
- $limit-=$len;
- break;
- case 23:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->downloadsCountText_ = $tmp;
- $limit-=$len;
- break;
- case 26:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->contactPhone_ = $tmp;
- $limit-=$len;
- break;
- case 27:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->contactWebsite_ = $tmp;
- $limit-=$len;
- break;
- case 30:
- ASSERT('$wire == 0');
- $tmp = Protobuf::read_varint($fp, $limit);
- if ($tmp === false)
- throw new Exception('Protobuf::read_varint returned false');
- $this->screenshotsCount_ = $tmp;
-
- break;
- case 31:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->promoText_ = $tmp;
- $limit-=$len;
- break;
- case 38:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->recentChanges_ = $tmp;
- $limit-=$len;
- break;
- case 43:
- ASSERT('$wire == 2');
- $len = Protobuf::read_varint($fp, $limit);
- if ($len === false)
- throw new Exception('Protobuf::read_varint returned false');
- if ($len > 0)
- $tmp = fread($fp, $len);
- else
- $tmp = '';
- if ($tmp === false)
- throw new Exception("fread($len) returned false");
- $this->promotionalVideo_ = $tmp;
- $limit-=$len;
- break;
- default:
- $this->_unknown[$field . '-' . Protobuf::get_wiretype($wire)][] = Protobuf::read_field($fp, $wire, $limit);
- }
- }
- if (!$this->validateRequired())
- throw new Exception('Required fields are missing');
- }
-
- function write($fp) {
- if (!$this->validateRequired())
- throw new Exception('Required fields are missing');
- if (!is_null($this->description_)) {
- fwrite($fp, "j");
- Protobuf::write_varint($fp, strlen($this->description_));
- fwrite($fp, $this->description_);
- }
- if (!is_null($this->downloadsCount_)) {
- fwrite($fp, "p");
- Protobuf::write_varint($fp, $this->downloadsCount_);
- }
- if (!is_null($this->permissionId_))
- foreach($this->permissionId_ as $v) {
- fwrite($fp, "z");
- Protobuf::write_varint($fp, strlen($v));
- fwrite($fp, $v);
- }
- if (!is_null($this->installSize_)) {
- fwrite($fp, "\x80\x01");
- Protobuf::write_varint($fp, $this->installSize_);
- }
- if (!is_null($this->packageName_)) {
- fwrite($fp, "\x8a\x01");
- Protobuf::write_varint($fp, strlen($this->packageName_));
- fwrite($fp, $this->packageName_);
- }
- if (!is_null($this->category_)) {
- fwrite($fp, "\x92\x01");
- Protobuf::write_varint($fp, strlen($this->category_));
- fwrite($fp, $this->category_);
- }
- if (!is_null($this->contactEmail_)) {
- fwrite($fp, "\xa2\x01");
- Protobuf::write_varint($fp, strlen($this->contactEmail_));
- fwrite($fp, $this->contactEmail_);
- }
- if (!is_null($this->downloadsCountText_)) {
- fwrite($fp, "\xba\x01");
- Protobuf::write_varint($fp, strlen($this->downloadsCountText_));
- fwrite($fp, $this->downloadsCountText_);
- }
- if (!is_null($this->contactPhone_)) {
- fwrite($fp, "\xd2\x01");
- Protobuf::write_varint($fp, strlen($this->contactPhone_));
- fwrite($fp, $this->contactPhone_);
- }
- if (!is_null($this->contactWebsite_)) {
- fwrite($fp, "\xda\x01");
- Protobuf::write_varint($fp, strlen($this->contactWebsite_));
- fwrite($fp, $this->contactWebsite_);
- }
- if (!is_null($this->screenshotsCount_)) {
- fwrite($fp, "\xf0\x01");
- Protobuf::write_varint($fp, $this->screenshotsCount_);
- }
- if (!is_null($this->promoText_)) {
- fwrite($fp, "\xfa\x01");
- Protobuf::write_varint($fp, strlen($this->promoText_));
- fwrite($fp, $this->promoText_);
- }
- if (!is_null($this->recentChanges_)) {
- fwrite($fp, "\xb2\x02");
- Protobuf::write_varint($fp, strlen($this->recentChanges_));
- fwrite($fp, $this->recentChanges_);
- }
- if (!is_null($this->promotionalVideo_)) {
- fwrite($fp, "\xda\x02");
- Protobuf::write_varint($fp, strlen($this->promotionalVideo_));
- fwrite($fp, $this->promotionalVideo_);
- }
- }
-
- public function size() {
- $size = 0;
- if (!is_null($this->description_)) {
- $l = strlen($this->description_);
- $size += 1 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->downloadsCount_)) {
- $size += 1 + Protobuf::size_varint($this->downloadsCount_);
- }
- if (!is_null($this->permissionId_))
- foreach($this->permissionId_ as $v) {
- $l = strlen($v);
- $size += 1 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->installSize_)) {
- $size += 2 + Protobuf::size_varint($this->installSize_);
- }
- if (!is_null($this->packageName_)) {
- $l = strlen($this->packageName_);
- $size += 2 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->category_)) {
- $l = strlen($this->category_);
- $size += 2 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->contactEmail_)) {
- $l = strlen($this->contactEmail_);
- $size += 2 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->downloadsCountText_)) {
- $l = strlen($this->downloadsCountText_);
- $size += 2 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->contactPhone_)) {
- $l = strlen($this->contactPhone_);
- $size += 2 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->contactWebsite_)) {
- $l = strlen($this->contactWebsite_);
- $size += 2 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->screenshotsCount_)) {
- $size += 2 + Protobuf::size_varint($this->screenshotsCount_);
- }
- if (!is_null($this->promoText_)) {
- $l = strlen($this->promoText_);
- $size += 2 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->recentChanges_)) {
- $l = strlen($this->recentChanges_);
- $size += 2 + Protobuf::size_varint($l) + $l;
- }
- if (!is_null($this->promotionalVideo_)) {
- $l = strlen($this->promotionalVideo_);
- $size += 2 + Protobuf::size_varint($l) + $l;
- }
- return $size;
- }
-
- public function validateRequired() {
- return true;
- }
-
- public function __toString() {
- return ''
- . Protobuf::toString('unknown', $this->_unknown)
- . Protobuf::toString('description_', $this->description_)
- . Protobuf::toString('downloadsCount_', $this->downloadsCount_)
- . Protobuf::toString('permissionId_', $this->permissionId_)
- . Protobuf::toString('installSize_', $this->installSize_)
- . Protobuf::toString('packageName_', $this->packageName_)
- . Protobuf::toString('category_', $this->category_)
- . Protobuf::toString('contactEmail_', $this->contactEmail_)
- . Protobuf::toString('downloadsCountText_', $this->downloadsCountText_)
- . Protobuf::toString('contactPhone_', $this->contactPhone_)
- . Protobuf::toString('contactWebsite_', $this->contactWebsite_)
- . Protobuf::toString('screenshotsCount_', $this->screenshotsCount_)
- . Protobuf::toString('promoText_', $this->promoText_)
- . Protobuf::toString('recentChanges_', $this->recentChanges_)
- . Protobuf::toString('promotionalVideo_', $this->promotionalVideo_);
- }
-
- // optional string description = 13;
- private $description_ = null;
- public function clearDescription() { $this->description_ = null; }
- public function hasDescription() { return $this->description_ !== null; }
- public function getDescription() { if($this->description_ === null) return ""; else return $this->description_; }
- public function setDescription($value) { $this->description_ = $value; }
-
- // optional int32 downloadsCount = 14;
- private $downloadsCount_ = null;
- public function clearDownloadsCount() { $this->downloadsCount_ = null; }
- public function hasDownloadsCount() { return $this->downloadsCount_ !== null; }
- public function getDownloadsCount() { if($this->downloadsCount_ === null) return 0; else return $this->downloadsCount_; }
- public function setDownloadsCount($value) { $this->downloadsCount_ = $value; }
-
- // repeated string permissionId = 15;
- private $permissionId_ = null;
- public function clearPermissionId() { $this->permissionId_ = null; }
- public function getPermissionIdCount() { if ($this->permissionId_ === null ) return 0; else return count($this->permissionId_); }
- public function getPermissionId($index) { return $this->permissionId_[$index]; }
- public function getPermissionIdArray() { if ($this->permissionId_ === null ) return array(); else return $this->permissionId_; }
- public function setPermissionId($index, $value) {$this->permissionId_[$index] = $value; }
- public function addPermissionId($value) { $this->permissionId_[] = $value; }
- public function addAllPermissionId(array $values) { foreach($values as $value) {$this->permissionId_[] = $value;} }
-
- // optional int32 installSize = 16;
- private $installSize_ = null;
- public function clearInstallSize() { $this->installSize_ = null; }
- public function hasInstallSize() { return $this->installSize_ !== null; }
- public function getInstallSize() { if($this->installSize_ === null) return 0; else return $this->installSize_; }
- public function setInstallSize($value) { $this->installSize_ = $value; }
-
- // optional string packageName = 17;
- private $packageName_ = null;
- public function clearPackageName() { $this->packageName_ = null; }
- public function hasPackageName() { return $this->packageName_ !== null; }
- public function getPackageName() { if($this->packageName_ === null) return ""; else return $this->packageName_; }
- public function setPackageName($value) { $this->packageName_ = $value; }
-
- // optional string category = 18;
- private $category_ = null;
- public function clearCategory() { $this->category_ = null; }
- public function hasCategory() { return $this->category_ !== null; }
- public function getCategory() { if($this->category_ === null) return ""; else return $this->category_; }
- public function setCategory($value) { $this->category_ = $value; }
-
- // optional string contactEmail = 20;
- private $contactEmail_ = null;
- public function clearContactEmail() { $this->contactEmail_ = null; }
- public function hasContactEmail() { return $this->contactEmail_ !== null; }
- public function getContactEmail() { if($this->contactEmail_ === null) return ""; else return $this->contactEmail_; }
- public function setContactEmail($value) { $this->contactEmail_ = $value; }
-
- // optional string downloadsCountText = 23;
- private $downloadsCountText_ = null;
- public function clearDownloadsCountText() { $this->downloadsCountText_ = null; }
- public function hasDownloadsCountText() { return $this->downloadsCountText_ !== null; }
- public function getDownloadsCountText() { if($this->downloadsCountText_ === null) return ""; else return $this->downloadsCountText_; }
- public function setDownloadsCountText($value) { $this->downloadsCountText_ = $value; }
-
- // optional string contactPhone = 26;
- private $contactPhone_ = null;
- public function clearContactPhone() { $this->contactPhone_ = null; }
- public function hasContactPhone() { return $this->contactPhone_ !== null; }
- public function getContactPhone() { if($this->contactPhone_ === null) return ""; else return $this->contactPhone_; }
- public function setContactPhone($value) { $this->contactPhone_ = $value; }
-
- // optional string contactWebsite = 27;
- private $contactWebsite_ = null;
- public function clearContactWebsite() { $this->contactWebsite_ = null; }
- public function hasContactWebsite() { return $this->contactWebsite_ !== null; }
- public function getContactWebsite() { if($this->contactWebsite_ === null) return ""; else return $this->contactWebsite_; }
- public function setContactWebsite($value) { $this->contactWebsite_ = $value; }
-
- // optional int32 screenshotsCount = 30;
- private $screenshotsCount_ = null;
- public function clearScreenshotsCount() { $this->screenshotsCount_ = null; }
- public function hasScreenshotsCount() { return $this->screenshotsCount_ !== null; }
- public function getScreenshotsCount() { if($this->screenshotsCount_ === null) return 0; else return $this->screenshotsCount_; }
- public function setScreenshotsCount($value) { $this->screenshotsCount_ = $value; }
-
- //