PluginProbe
Atarim – AI Agency for WordPress: Edit Pages, Fix Code, Update Plugins, SEO & Client Feedback / 3.3.2.2
Atarim – AI Agency for WordPress: Edit Pages, Fix Code, Update Plugins, SEO & Client Feedback v3.3.2.2
5.1.3 5.1.2 5.1.1 5.1 5.0 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 All 75 releases
atarim-visual-collaboration / src / Service.php
Service.php
73 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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