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 |
|
---|
18 | namespace Google\Service\FactCheckTools\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\FactCheckTools\GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponse;
|
---|
21 | use Google\Service\FactCheckTools\GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "claims" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $factchecktoolsService = new Google\Service\FactCheckTools(...);
|
---|
28 | * $claims = $factchecktoolsService->claims;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class Claims extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Search through fact-checked claims using an image as the query.
|
---|
35 | * (claims.imageSearch)
|
---|
36 | *
|
---|
37 | * @param array $optParams Optional parameters.
|
---|
38 | *
|
---|
39 | * @opt_param string imageUri Required. The URI of the source image. This must
|
---|
40 | * be a publicly-accessible image HTTP/HTTPS URL. When fetching images from
|
---|
41 | * HTTP/HTTPS URLs, Google cannot guarantee that the request will be completed.
|
---|
42 | * Your request may fail if the specified host denies the request (e.g. due to
|
---|
43 | * request throttling or DOS prevention), or if Google throttles requests to the
|
---|
44 | * site for abuse prevention. You should not depend on externally-hosted images
|
---|
45 | * for production applications.
|
---|
46 | * @opt_param string languageCode Optional. The BCP-47 language code, such as
|
---|
47 | * "en-US" or "sr-Latn". Can be used to restrict results by language, though we
|
---|
48 | * do not currently consider the region.
|
---|
49 | * @opt_param int offset Optional. An integer that specifies the current offset
|
---|
50 | * (that is, starting result location) in search results. This field is only
|
---|
51 | * considered if `page_token` is unset. For example, 0 means to return results
|
---|
52 | * starting from the first matching result, and 10 means to return from the 11th
|
---|
53 | * result.
|
---|
54 | * @opt_param int pageSize Optional. The pagination size. We will return up to
|
---|
55 | * that many results. Defaults to 10 if not set.
|
---|
56 | * @opt_param string pageToken Optional. The pagination token. You may provide
|
---|
57 | * the `next_page_token` returned from a previous List request, if any, in order
|
---|
58 | * to get the next page. All other fields must have the same values as in the
|
---|
59 | * previous request.
|
---|
60 | * @return GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponse
|
---|
61 | * @throws \Google\Service\Exception
|
---|
62 | */
|
---|
63 | public function imageSearch($optParams = [])
|
---|
64 | {
|
---|
65 | $params = [];
|
---|
66 | $params = array_merge($params, $optParams);
|
---|
67 | return $this->call('imageSearch', [$params], GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimImageSearchResponse::class);
|
---|
68 | }
|
---|
69 | /**
|
---|
70 | * Search through fact-checked claims. (claims.search)
|
---|
71 | *
|
---|
72 | * @param array $optParams Optional parameters.
|
---|
73 | *
|
---|
74 | * @opt_param string languageCode The BCP-47 language code, such as "en-US" or
|
---|
75 | * "sr-Latn". Can be used to restrict results by language, though we do not
|
---|
76 | * currently consider the region.
|
---|
77 | * @opt_param int maxAgeDays The maximum age of the returned search results, in
|
---|
78 | * days. Age is determined by either claim date or review date, whichever is
|
---|
79 | * newer.
|
---|
80 | * @opt_param int offset An integer that specifies the current offset (that is,
|
---|
81 | * starting result location) in search results. This field is only considered if
|
---|
82 | * `page_token` is unset. For example, 0 means to return results starting from
|
---|
83 | * the first matching result, and 10 means to return from the 11th result.
|
---|
84 | * @opt_param int pageSize The pagination size. We will return up to that many
|
---|
85 | * results. Defaults to 10 if not set.
|
---|
86 | * @opt_param string pageToken The pagination token. You may provide the
|
---|
87 | * `next_page_token` returned from a previous List request, if any, in order to
|
---|
88 | * get the next page. All other fields must have the same values as in the
|
---|
89 | * previous request.
|
---|
90 | * @opt_param string query Textual query string. Required unless
|
---|
91 | * `review_publisher_site_filter` is specified.
|
---|
92 | * @opt_param string reviewPublisherSiteFilter The review publisher site to
|
---|
93 | * filter results by, e.g. nytimes.com.
|
---|
94 | * @return GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse
|
---|
95 | * @throws \Google\Service\Exception
|
---|
96 | */
|
---|
97 | public function search($optParams = [])
|
---|
98 | {
|
---|
99 | $params = [];
|
---|
100 | $params = array_merge($params, $optParams);
|
---|
101 | return $this->call('search', [$params], GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse::class);
|
---|
102 | }
|
---|
103 | }
|
---|
104 |
|
---|
105 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
106 | class_alias(Claims::class, 'Google_Service_FactCheckTools_Resource_Claims');
|
---|