deleting obsolete docs/ directory
[gae.git] / python / php / sdk / google / appengine / api / capabilities / capability_service_pb.php
blobd0dcb4e1555cc7e3cfe9c75af276831d2a1fa178
1 <?php
2 /**
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
20 namespace dummy {
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)) {
30 return '';
32 return $this->package;
34 public function setPackage($val) {
35 $this->package = $val;
36 return $this;
38 public function clearPackage() {
39 unset($this->package);
40 return $this;
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;
56 return $this;
58 public function addCapability($val) {
59 $this->capability[] = $val;
60 return $this;
62 public function clearCapability() {
63 $this->capability = array();
65 public function getCallSize() {
66 return sizeof($this->call);
68 public function getCallList() {
69 return $this->call;
71 public function getCall($idx) {
72 return $this->call[$idx];
74 public function setCall($idx, $val) {
75 $this->call[$idx] = $val;
76 return $this;
78 public function addCall($val) {
79 $this->call[] = $val;
80 return $this;
82 public function clearCall() {
83 $this->call = array();
85 public function clear() {
86 $this->clearPackage();
87 $this->clearCapability();
88 $this->clearCall();
90 public function byteSizePartial() {
91 $res = 0;
92 if (isset($this->package)) {
93 $res += 1;
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));
106 return $res;
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();
127 switch ($tt) {
128 case 10:
129 $length = $d->getVarInt32();
130 $this->setPackage(substr($d->buffer(), $d->pos(), $length));
131 $d->skip($length);
132 break;
133 case 18:
134 $length = $d->getVarInt32();
135 $this->addCapability(substr($d->buffer(), $d->pos(), $length));
136 $d->skip($length);
137 break;
138 case 26:
139 $length = $d->getVarInt32();
140 $this->addCall(substr($d->buffer(), $d->pos(), $length));
141 $d->skip($length);
142 break;
143 case 0:
144 throw new \google\net\ProtocolBufferDecodeError();
145 break;
146 default:
147 $d->skipData($tt);
151 public function checkInitialized() {
152 if (!isset($this->package)) return 'package';
153 return null;
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) {
164 $this->addCall($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;
179 return true;
181 public function shortDebugString($prefix = "") {
182 $res = '';
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";
192 return $res;
196 namespace google\appengine\IsEnabledResponse {
197 class SummaryStatus {
198 const ENABLED = 1;
199 const SCHEDULED_FUTURE = 2;
200 const SCHEDULED_NOW = 3;
201 const DISABLED = 4;
202 const UNKNOWN = 5;
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)) {
210 return 1;
212 return $this->summary_status;
214 public function setSummaryStatus($val) {
215 $this->summary_status = $val;
216 return $this;
218 public function clearSummaryStatus() {
219 unset($this->summary_status);
220 return $this;
222 public function hasSummaryStatus() {
223 return isset($this->summary_status);
225 public function getTimeUntilScheduled() {
226 if (!isset($this->time_until_scheduled)) {
227 return "0";
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);
234 } else {
235 $this->time_until_scheduled = $val;
237 return $this;
239 public function clearTimeUntilScheduled() {
240 unset($this->time_until_scheduled);
241 return $this;
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;
256 return $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;
272 return $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() {
283 $res = 0;
284 if (isset($this->summary_status)) {
285 $res += 1;
286 $res += $this->lengthVarInt64($this->summary_status);
288 if (isset($this->time_until_scheduled)) {
289 $res += 1;
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());
297 return $res;
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();
318 switch ($tt) {
319 case 8:
320 $this->setSummaryStatus($d->getVarInt32());
321 break;
322 case 16:
323 $this->setTimeUntilScheduled($d->getVarInt64());
324 break;
325 case 26:
326 $length = $d->getVarInt32();
327 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
328 $d->skip($length);
329 $this->addConfig()->tryMerge($tmp);
330 break;
331 case 0:
332 throw new \google\net\ProtocolBufferDecodeError();
333 break;
334 default:
335 $d->skipData($tt);
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';
344 return null;
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;
368 return true;
370 public function shortDebugString($prefix = "") {
371 $res = '';
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";
381 return $res;