3 * Copyright 2007 Google Inc.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 # Generated by the protocol buffer compiler. DO NOT EDIT!
18 # source: google/appengine/api/capabilities/capability_service.proto
21 require_once 'google/appengine/runtime/proto/ProtocolMessage.php';
22 require_once 'google/appengine/base/capabilities_pb.php';
24 namespace google\appengine
{
25 class IsEnabledRequest
extends \google\net\ProtocolMessage
{
26 private $capability = array();
27 private $call = array();
28 public function getPackage() {
29 if (!isset($this->package
)) {
32 return $this->package
;
34 public function setPackage($val) {
35 $this->package
= $val;
38 public function clearPackage() {
39 unset($this->package
);
42 public function hasPackage() {
43 return isset($this->package
);
45 public function getCapabilitySize() {
46 return sizeof($this->capability
);
48 public function getCapabilityList() {
49 return $this->capability
;
51 public function getCapability($idx) {
52 return $this->capability
[$idx];
54 public function setCapability($idx, $val) {
55 $this->capability
[$idx] = $val;
58 public function addCapability($val) {
59 $this->capability
[] = $val;
62 public function clearCapability() {
63 $this->capability
= array();
65 public function getCallSize() {
66 return sizeof($this->call
);
68 public function getCallList() {
71 public function getCall($idx) {
72 return $this->call
[$idx];
74 public function setCall($idx, $val) {
75 $this->call
[$idx] = $val;
78 public function addCall($val) {
82 public function clearCall() {
83 $this->call
= array();
85 public function clear() {
86 $this->clearPackage();
87 $this->clearCapability();
90 public function byteSizePartial() {
92 if (isset($this->package
)) {
94 $res +
= $this->lengthString(strlen($this->package
));
96 $this->checkProtoArray($this->capability
);
97 $res +
= 1 * sizeof($this->capability
);
98 foreach ($this->capability
as $value) {
99 $res +
= $this->lengthString(strlen($value));
101 $this->checkProtoArray($this->call
);
102 $res +
= 1 * sizeof($this->call
);
103 foreach ($this->call
as $value) {
104 $res +
= $this->lengthString(strlen($value));
108 public function outputPartial($out) {
109 if (isset($this->package
)) {
110 $out->putVarInt32(10);
111 $out->putPrefixedString($this->package
);
113 $this->checkProtoArray($this->capability
);
114 foreach ($this->capability
as $value) {
115 $out->putVarInt32(18);
116 $out->putPrefixedString($value);
118 $this->checkProtoArray($this->call
);
119 foreach ($this->call
as $value) {
120 $out->putVarInt32(26);
121 $out->putPrefixedString($value);
124 public function tryMerge($d) {
125 while($d->avail() > 0) {
126 $tt = $d->getVarInt32();
129 $length = $d->getVarInt32();
130 $this->setPackage(substr($d->buffer(), $d->pos(), $length));
134 $length = $d->getVarInt32();
135 $this->addCapability(substr($d->buffer(), $d->pos(), $length));
139 $length = $d->getVarInt32();
140 $this->addCall(substr($d->buffer(), $d->pos(), $length));
144 throw new \google\net\
ProtocolBufferDecodeError();
151 public function checkInitialized() {
152 if (!isset($this->package
)) return 'package';
155 public function mergeFrom($x) {
156 if ($x === $this) { throw new \
IllegalArgumentException('Cannot copy message to itself'); }
157 if ($x->hasPackage()) {
158 $this->setPackage($x->getPackage());
160 foreach ($x->getCapabilityList() as $v) {
161 $this->addCapability($v);
163 foreach ($x->getCallList() as $v) {
167 public function equals($x) {
168 if ($x === $this) { return true; }
169 if (isset($this->package
) !== isset($x->package
)) return false;
170 if (isset($this->package
) && $this->package
!== $x->package
) return false;
171 if (sizeof($this->capability
) !== sizeof($x->capability
)) return false;
172 foreach (array_map(null, $this->capability
, $x->capability
) as $v) {
173 if ($v[0] !== $v[1]) return false;
175 if (sizeof($this->call
) !== sizeof($x->call
)) return false;
176 foreach (array_map(null, $this->call
, $x->call
) as $v) {
177 if ($v[0] !== $v[1]) return false;
181 public function shortDebugString($prefix = "") {
183 if (isset($this->package
)) {
184 $res .= $prefix . "package: " . $this->debugFormatString($this->package
) . "\n";
186 foreach ($this->capability
as $value) {
187 $res .= $prefix . "capability: " . $this->debugFormatString($value) . "\n";
189 foreach ($this->call
as $value) {
190 $res .= $prefix . "call: " . $this->debugFormatString($value) . "\n";
196 namespace google\appengine\IsEnabledResponse
{
197 class SummaryStatus
{
199 const SCHEDULED_FUTURE
= 2;
200 const SCHEDULED_NOW
= 3;
205 namespace google\appengine
{
206 class IsEnabledResponse
extends \google\net\ProtocolMessage
{
207 private $config = array();
208 public function getSummaryStatus() {
209 if (!isset($this->summary_status
)) {
212 return $this->summary_status
;
214 public function setSummaryStatus($val) {
215 $this->summary_status
= $val;
218 public function clearSummaryStatus() {
219 unset($this->summary_status
);
222 public function hasSummaryStatus() {
223 return isset($this->summary_status
);
225 public function getTimeUntilScheduled() {
226 if (!isset($this->time_until_scheduled
)) {
229 return $this->time_until_scheduled
;
231 public function setTimeUntilScheduled($val) {
232 if (is_double($val)) {
233 $this->time_until_scheduled
= sprintf('%0.0F', $val);
235 $this->time_until_scheduled
= $val;
239 public function clearTimeUntilScheduled() {
240 unset($this->time_until_scheduled
);
243 public function hasTimeUntilScheduled() {
244 return isset($this->time_until_scheduled
);
246 public function getConfigSize() {
247 return sizeof($this->config
);
249 public function getConfigList() {
250 return $this->config
;
252 public function mutableConfig($idx) {
253 if (!isset($this->config
[$idx])) {
254 $val = new \google\appengine\
CapabilityConfig();
255 $this->config
[$idx] = $val;
258 return $this->config
[$idx];
260 public function getConfig($idx) {
261 if (isset($this->config
[$idx])) {
262 return $this->config
[$idx];
264 if ($idx >= end(array_keys($this->config
))) {
265 throw new \
OutOfRangeException('index out of range: ' +
$idx);
267 return new \google\appengine\
CapabilityConfig();
269 public function addConfig() {
270 $val = new \google\appengine\
CapabilityConfig();
271 $this->config
[] = $val;
274 public function clearConfig() {
275 $this->config
= array();
277 public function clear() {
278 $this->clearSummaryStatus();
279 $this->clearTimeUntilScheduled();
280 $this->clearConfig();
282 public function byteSizePartial() {
284 if (isset($this->summary_status
)) {
286 $res +
= $this->lengthVarInt64($this->summary_status
);
288 if (isset($this->time_until_scheduled
)) {
290 $res +
= $this->lengthVarInt64($this->time_until_scheduled
);
292 $this->checkProtoArray($this->config
);
293 $res +
= 1 * sizeof($this->config
);
294 foreach ($this->config
as $value) {
295 $res +
= $this->lengthString($value->byteSizePartial());
299 public function outputPartial($out) {
300 if (isset($this->summary_status
)) {
301 $out->putVarInt32(8);
302 $out->putVarInt32($this->summary_status
);
304 if (isset($this->time_until_scheduled
)) {
305 $out->putVarInt32(16);
306 $out->putVarInt64($this->time_until_scheduled
);
308 $this->checkProtoArray($this->config
);
309 foreach ($this->config
as $value) {
310 $out->putVarInt32(26);
311 $out->putVarInt32($value->byteSizePartial());
312 $value->outputPartial($out);
315 public function tryMerge($d) {
316 while($d->avail() > 0) {
317 $tt = $d->getVarInt32();
320 $this->setSummaryStatus($d->getVarInt32());
323 $this->setTimeUntilScheduled($d->getVarInt64());
326 $length = $d->getVarInt32();
327 $tmp = new \google\net\
Decoder($d->buffer(), $d->pos(), $d->pos() +
$length);
329 $this->addConfig()->tryMerge($tmp);
332 throw new \google\net\
ProtocolBufferDecodeError();
339 public function checkInitialized() {
340 if (!isset($this->summary_status
)) return 'summary_status';
341 foreach ($this->config
as $value) {
342 if (!$value->isInitialized()) return 'config';
346 public function mergeFrom($x) {
347 if ($x === $this) { throw new \
IllegalArgumentException('Cannot copy message to itself'); }
348 if ($x->hasSummaryStatus()) {
349 $this->setSummaryStatus($x->getSummaryStatus());
351 if ($x->hasTimeUntilScheduled()) {
352 $this->setTimeUntilScheduled($x->getTimeUntilScheduled());
354 foreach ($x->getConfigList() as $v) {
355 $this->addConfig()->copyFrom($v);
358 public function equals($x) {
359 if ($x === $this) { return true; }
360 if (isset($this->summary_status
) !== isset($x->summary_status
)) return false;
361 if (isset($this->summary_status
) && $this->summary_status
!== $x->summary_status
) return false;
362 if (isset($this->time_until_scheduled
) !== isset($x->time_until_scheduled
)) return false;
363 if (isset($this->time_until_scheduled
) && !$this->integerEquals($this->time_until_scheduled
, $x->time_until_scheduled
)) return false;
364 if (sizeof($this->config
) !== sizeof($x->config
)) return false;
365 foreach (array_map(null, $this->config
, $x->config
) as $v) {
366 if (!$v[0]->equals($v[1])) return false;
370 public function shortDebugString($prefix = "") {
372 if (isset($this->summary_status
)) {
373 $res .= $prefix . "summary_status: " . ($this->summary_status
) . "\n";
375 if (isset($this->time_until_scheduled
)) {
376 $res .= $prefix . "time_until_scheduled: " . $this->debugFormatInt64($this->time_until_scheduled
) . "\n";
378 foreach ($this->config
as $value) {
379 $res .= $prefix . "config <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";