PluginProbe ʕ •ᴥ•ʔ
Atarim – Visual Feedback, Review & AI Collaboration / 4.2
Atarim – Visual Feedback, Review & AI Collaboration v4.2
trunk 3.10 3.11 3.12 3.13 3.14 3.15 3.16 3.17 3.18 3.19 3.2.0 3.2.1 3.22 3.22.1 3.22.2 3.22.3 3.22.4 3.22.5 3.22.6 3.3.0 3.3.1 3.3.2 3.3.2.1 3.3.2.2 3.3.3 3.30 3.31 3.32 3.4 3.4.1 3.4.3 3.4.4 3.5 3.5.1 3.6 3.6.1 3.7 3.8 3.9 3.9.1 3.9.2 3.9.3 3.9.4 3.9.6 3.9.6.1 4.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.2 4.1.3 4.2 4.2.1 4.2.2 4.3 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.4
atarim-visual-collaboration / src / Service.php
atarim-visual-collaboration / src Last commit date
AccessToken 1 year ago AuthHandler 1 year ago Http 1 year ago Service 1 year ago Task 1 year ago Utils 1 year ago Client.php 1 year ago Collection.php 1 year ago Exception.php 1 year ago Model.php 1 year ago Service.php 1 year ago aliases.php 1 year ago
Service.php
73 lines
1 <?php
2 /*
3 * Copyright 2010 Google Inc.
4 *
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
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
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.
16 */
17
18 namespace Google;
19
20 use Google\Http\Batch;
21 use TypeError;
22
23 class Service
24 {
25 public $batchPath;
26 public $rootUrl;
27 public $version;
28 public $servicePath;
29 public $serviceName;
30 public $availableScopes;
31 public $resource;
32 private $client;
33
34 public function __construct($clientOrConfig = [])
35 {
36 if ($clientOrConfig instanceof Client) {
37 $this->client = $clientOrConfig;
38 } elseif (is_array($clientOrConfig)) {
39 $this->client = new Client($clientOrConfig ?: []);
40 } else {
41 $errorMessage = 'constructor must be array or instance of Google\Client';
42 if (class_exists('TypeError')) {
43 throw new TypeError($errorMessage);
44 }
45 trigger_error($errorMessage, E_USER_ERROR);
46 }
47 }
48
49 /**
50 * Return the associated Google\Client class.
51 * @return \Google\Client
52 */
53 public function getClient()
54 {
55 return $this->client;
56 }
57
58 /**
59 * Create a new HTTP Batch handler for this service
60 *
61 * @return Batch
62 */
63 public function createBatch()
64 {
65 return new Batch(
66 $this->client,
67 false,
68 $this->rootUrl,
69 $this->batchPath
70 );
71 }
72 }
73