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\Adsense\Resource;
19
20use Google\Service\Adsense\AdClientAdCode;
21use Google\Service\Adsense\ListAdClientsResponse;
22
23/**
24 * The "adclients" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $adsenseService = new Google\Service\Adsense(...);
28 *   $adclients = $adsenseService->adclients;
29 *  </code>
30 */
31class AccountsAdclients extends \Google\Service\Resource
32{
33  /**
34   * Gets the AdSense code for a given ad client. This returns what was previously
35   * known as the 'auto ad code'. This is only supported for ad clients with a
36   * product_code of AFC. For more information, see [About the AdSense
37   * code](https://support.google.com/adsense/answer/9274634).
38   * (adclients.getAdcode)
39   *
40   * @param string $name Required. Name of the ad client for which to get the
41   * adcode. Format: accounts/{account}/adclients/{adclient}
42   * @param array $optParams Optional parameters.
43   * @return AdClientAdCode
44   */
45  public function getAdcode($name, $optParams = [])
46  {
47    $params = ['name' => $name];
48    $params = array_merge($params, $optParams);
49    return $this->call('getAdcode', [$params], AdClientAdCode::class);
50  }
51  /**
52   * Lists all the ad clients available in an account.
53   * (adclients.listAccountsAdclients)
54   *
55   * @param string $parent Required. The account which owns the collection of ad
56   * clients. Format: accounts/{account}
57   * @param array $optParams Optional parameters.
58   *
59   * @opt_param int pageSize The maximum number of ad clients to include in the
60   * response, used for paging. If unspecified, at most 10000 ad clients will be
61   * returned. The maximum value is 10000; values above 10000 will be coerced to
62   * 10000.
63   * @opt_param string pageToken A page token, received from a previous
64   * `ListAdClients` call. Provide this to retrieve the subsequent page. When
65   * paginating, all other parameters provided to `ListAdClients` must match the
66   * call that provided the page token.
67   * @return ListAdClientsResponse
68   */
69  public function listAccountsAdclients($parent, $optParams = [])
70  {
71    $params = ['parent' => $parent];
72    $params = array_merge($params, $optParams);
73    return $this->call('list', [$params], ListAdClientsResponse::class);
74  }
75}
76
77// Adding a class alias for backwards compatibility with the previous class name.
78class_alias(AccountsAdclients::class, 'Google_Service_Adsense_Resource_AccountsAdclients');
79