WebRisk.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * 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, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service;
  18. use Google\Client;
  19. /**
  20. * Service definition for WebRisk (v1).
  21. *
  22. * <p>
  23. </p>
  24. *
  25. * <p>
  26. * For more information about this service, see the API
  27. * <a href="https://cloud.google.com/web-risk/" target="_blank">Documentation</a>
  28. * </p>
  29. *
  30. * @author Google, Inc.
  31. */
  32. class WebRisk extends \Google\Service
  33. {
  34. /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
  35. const CLOUD_PLATFORM =
  36. "https://www.googleapis.com/auth/cloud-platform";
  37. public $hashes;
  38. public $projects_operations;
  39. public $projects_submissions;
  40. public $threatLists;
  41. public $uris;
  42. public $rootUrlTemplate;
  43. /**
  44. * Constructs the internal representation of the WebRisk service.
  45. *
  46. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  47. * config array to pass to a new Client instance.
  48. * @param string $rootUrl The root URL used for requests to the service.
  49. */
  50. public function __construct($clientOrConfig = [], $rootUrl = null)
  51. {
  52. parent::__construct($clientOrConfig);
  53. $this->rootUrl = $rootUrl ?: 'https://webrisk.googleapis.com/';
  54. $this->rootUrlTemplate = $rootUrl ?: 'https://webrisk.UNIVERSE_DOMAIN/';
  55. $this->servicePath = '';
  56. $this->batchPath = 'batch';
  57. $this->version = 'v1';
  58. $this->serviceName = 'webrisk';
  59. $this->hashes = new WebRisk\Resource\Hashes(
  60. $this,
  61. $this->serviceName,
  62. 'hashes',
  63. [
  64. 'methods' => [
  65. 'search' => [
  66. 'path' => 'v1/hashes:search',
  67. 'httpMethod' => 'GET',
  68. 'parameters' => [
  69. 'hashPrefix' => [
  70. 'location' => 'query',
  71. 'type' => 'string',
  72. ],
  73. 'threatTypes' => [
  74. 'location' => 'query',
  75. 'type' => 'string',
  76. 'repeated' => true,
  77. ],
  78. ],
  79. ],
  80. ]
  81. ]
  82. );
  83. $this->projects_operations = new WebRisk\Resource\ProjectsOperations(
  84. $this,
  85. $this->serviceName,
  86. 'operations',
  87. [
  88. 'methods' => [
  89. 'cancel' => [
  90. 'path' => 'v1/{+name}:cancel',
  91. 'httpMethod' => 'POST',
  92. 'parameters' => [
  93. 'name' => [
  94. 'location' => 'path',
  95. 'type' => 'string',
  96. 'required' => true,
  97. ],
  98. ],
  99. ],'delete' => [
  100. 'path' => 'v1/{+name}',
  101. 'httpMethod' => 'DELETE',
  102. 'parameters' => [
  103. 'name' => [
  104. 'location' => 'path',
  105. 'type' => 'string',
  106. 'required' => true,
  107. ],
  108. ],
  109. ],'get' => [
  110. 'path' => 'v1/{+name}',
  111. 'httpMethod' => 'GET',
  112. 'parameters' => [
  113. 'name' => [
  114. 'location' => 'path',
  115. 'type' => 'string',
  116. 'required' => true,
  117. ],
  118. ],
  119. ],'list' => [
  120. 'path' => 'v1/{+name}/operations',
  121. 'httpMethod' => 'GET',
  122. 'parameters' => [
  123. 'name' => [
  124. 'location' => 'path',
  125. 'type' => 'string',
  126. 'required' => true,
  127. ],
  128. 'filter' => [
  129. 'location' => 'query',
  130. 'type' => 'string',
  131. ],
  132. 'pageSize' => [
  133. 'location' => 'query',
  134. 'type' => 'integer',
  135. ],
  136. 'pageToken' => [
  137. 'location' => 'query',
  138. 'type' => 'string',
  139. ],
  140. 'returnPartialSuccess' => [
  141. 'location' => 'query',
  142. 'type' => 'boolean',
  143. ],
  144. ],
  145. ],
  146. ]
  147. ]
  148. );
  149. $this->projects_submissions = new WebRisk\Resource\ProjectsSubmissions(
  150. $this,
  151. $this->serviceName,
  152. 'submissions',
  153. [
  154. 'methods' => [
  155. 'create' => [
  156. 'path' => 'v1/{+parent}/submissions',
  157. 'httpMethod' => 'POST',
  158. 'parameters' => [
  159. 'parent' => [
  160. 'location' => 'path',
  161. 'type' => 'string',
  162. 'required' => true,
  163. ],
  164. ],
  165. ],
  166. ]
  167. ]
  168. );
  169. $this->threatLists = new WebRisk\Resource\ThreatLists(
  170. $this,
  171. $this->serviceName,
  172. 'threatLists',
  173. [
  174. 'methods' => [
  175. 'computeDiff' => [
  176. 'path' => 'v1/threatLists:computeDiff',
  177. 'httpMethod' => 'GET',
  178. 'parameters' => [
  179. 'constraints.maxDatabaseEntries' => [
  180. 'location' => 'query',
  181. 'type' => 'integer',
  182. ],
  183. 'constraints.maxDiffEntries' => [
  184. 'location' => 'query',
  185. 'type' => 'integer',
  186. ],
  187. 'constraints.supportedCompressions' => [
  188. 'location' => 'query',
  189. 'type' => 'string',
  190. 'repeated' => true,
  191. ],
  192. 'threatType' => [
  193. 'location' => 'query',
  194. 'type' => 'string',
  195. ],
  196. 'versionToken' => [
  197. 'location' => 'query',
  198. 'type' => 'string',
  199. ],
  200. ],
  201. ],
  202. ]
  203. ]
  204. );
  205. $this->uris = new WebRisk\Resource\Uris(
  206. $this,
  207. $this->serviceName,
  208. 'uris',
  209. [
  210. 'methods' => [
  211. 'search' => [
  212. 'path' => 'v1/uris:search',
  213. 'httpMethod' => 'GET',
  214. 'parameters' => [
  215. 'threatTypes' => [
  216. 'location' => 'query',
  217. 'type' => 'string',
  218. 'repeated' => true,
  219. ],
  220. 'uri' => [
  221. 'location' => 'query',
  222. 'type' => 'string',
  223. ],
  224. ],
  225. ],
  226. ]
  227. ]
  228. );
  229. }
  230. }
  231. // Adding a class alias for backwards compatibility with the previous class name.
  232. class_alias(WebRisk::class, 'Google_Service_WebRisk');