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