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\GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage;
|
---|
21 | use Google\Service\FactCheckTools\GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse;
|
---|
22 | use Google\Service\FactCheckTools\GoogleProtobufEmpty;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "pages" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $factchecktoolsService = new Google\Service\FactCheckTools(...);
|
---|
29 | * $pages = $factchecktoolsService->pages;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class Pages extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Create `ClaimReview` markup on a page. (pages.create)
|
---|
36 | *
|
---|
37 | * @param GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage $postBody
|
---|
38 | * @param array $optParams Optional parameters.
|
---|
39 | * @return GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage
|
---|
40 | * @throws \Google\Service\Exception
|
---|
41 | */
|
---|
42 | public function create(GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage $postBody, $optParams = [])
|
---|
43 | {
|
---|
44 | $params = ['postBody' => $postBody];
|
---|
45 | $params = array_merge($params, $optParams);
|
---|
46 | return $this->call('create', [$params], GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage::class);
|
---|
47 | }
|
---|
48 | /**
|
---|
49 | * Delete all `ClaimReview` markup on a page. (pages.delete)
|
---|
50 | *
|
---|
51 | * @param string $name The name of the resource to delete, in the form of
|
---|
52 | * `pages/{page_id}`.
|
---|
53 | * @param array $optParams Optional parameters.
|
---|
54 | * @return GoogleProtobufEmpty
|
---|
55 | * @throws \Google\Service\Exception
|
---|
56 | */
|
---|
57 | public function delete($name, $optParams = [])
|
---|
58 | {
|
---|
59 | $params = ['name' => $name];
|
---|
60 | $params = array_merge($params, $optParams);
|
---|
61 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
62 | }
|
---|
63 | /**
|
---|
64 | * Get all `ClaimReview` markup on a page. (pages.get)
|
---|
65 | *
|
---|
66 | * @param string $name The name of the resource to get, in the form of
|
---|
67 | * `pages/{page_id}`.
|
---|
68 | * @param array $optParams Optional parameters.
|
---|
69 | * @return GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage
|
---|
70 | * @throws \Google\Service\Exception
|
---|
71 | */
|
---|
72 | public function get($name, $optParams = [])
|
---|
73 | {
|
---|
74 | $params = ['name' => $name];
|
---|
75 | $params = array_merge($params, $optParams);
|
---|
76 | return $this->call('get', [$params], GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage::class);
|
---|
77 | }
|
---|
78 | /**
|
---|
79 | * List the `ClaimReview` markup pages for a specific URL or for an
|
---|
80 | * organization. (pages.listPages)
|
---|
81 | *
|
---|
82 | * @param array $optParams Optional parameters.
|
---|
83 | *
|
---|
84 | * @opt_param int offset An integer that specifies the current offset (that is,
|
---|
85 | * starting result location) in search results. This field is only considered if
|
---|
86 | * `page_token` is unset, and if the request is not for a specific URL. For
|
---|
87 | * example, 0 means to return results starting from the first matching result,
|
---|
88 | * and 10 means to return from the 11th result.
|
---|
89 | * @opt_param string organization The organization for which we want to fetch
|
---|
90 | * markups for. For instance, "site.com". Cannot be specified along with an URL.
|
---|
91 | * @opt_param int pageSize The pagination size. We will return up to that many
|
---|
92 | * results. Defaults to 10 if not set. Has no effect if a URL is requested.
|
---|
93 | * @opt_param string pageToken The pagination token. You may provide the
|
---|
94 | * `next_page_token` returned from a previous List request, if any, in order to
|
---|
95 | * get the next page. All other fields must have the same values as in the
|
---|
96 | * previous request.
|
---|
97 | * @opt_param string url The URL from which to get `ClaimReview` markup. There
|
---|
98 | * will be at most one result. If markup is associated with a more canonical
|
---|
99 | * version of the URL provided, we will return that URL instead. Cannot be
|
---|
100 | * specified along with an organization.
|
---|
101 | * @return GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse
|
---|
102 | * @throws \Google\Service\Exception
|
---|
103 | */
|
---|
104 | public function listPages($optParams = [])
|
---|
105 | {
|
---|
106 | $params = [];
|
---|
107 | $params = array_merge($params, $optParams);
|
---|
108 | return $this->call('list', [$params], GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse::class);
|
---|
109 | }
|
---|
110 | /**
|
---|
111 | * Update for all `ClaimReview` markup on a page Note that this is a full
|
---|
112 | * update. To retain the existing `ClaimReview` markup on a page, first perform
|
---|
113 | * a Get operation, then modify the returned markup, and finally call Update
|
---|
114 | * with the entire `ClaimReview` markup as the body. (pages.update)
|
---|
115 | *
|
---|
116 | * @param string $name The name of this `ClaimReview` markup page resource, in
|
---|
117 | * the form of `pages/{page_id}`. Except for update requests, this field is
|
---|
118 | * output-only and should not be set by the user.
|
---|
119 | * @param GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage $postBody
|
---|
120 | * @param array $optParams Optional parameters.
|
---|
121 | * @return GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage
|
---|
122 | * @throws \Google\Service\Exception
|
---|
123 | */
|
---|
124 | public function update($name, GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage $postBody, $optParams = [])
|
---|
125 | {
|
---|
126 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
127 | $params = array_merge($params, $optParams);
|
---|
128 | return $this->call('update', [$params], GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage::class);
|
---|
129 | }
|
---|
130 | }
|
---|
131 |
|
---|
132 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
133 | class_alias(Pages::class, 'Google_Service_FactCheckTools_Resource_Pages');
|
---|