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\CustomChannel;
21use Google\Service\Adsense\ListCustomChannelsResponse;
22use Google\Service\Adsense\ListLinkedAdUnitsResponse;
23
24/**
25 * The "customchannels" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $adsenseService = new Google\Service\Adsense(...);
29 *   $customchannels = $adsenseService->customchannels;
30 *  </code>
31 */
32class AccountsAdclientsCustomchannels extends \Google\Service\Resource
33{
34  /**
35   * Gets information about the selected custom channel. (customchannels.get)
36   *
37   * @param string $name Required. Name of the custom channel. Format:
38   * accounts/{account}/adclients/{adclient}/customchannels/{customchannel}
39   * @param array $optParams Optional parameters.
40   * @return CustomChannel
41   */
42  public function get($name, $optParams = [])
43  {
44    $params = ['name' => $name];
45    $params = array_merge($params, $optParams);
46    return $this->call('get', [$params], CustomChannel::class);
47  }
48  /**
49   * Lists all the custom channels available in an ad client.
50   * (customchannels.listAccountsAdclientsCustomchannels)
51   *
52   * @param string $parent Required. The ad client which owns the collection of
53   * custom channels. Format: accounts/{account}/adclients/{adclient}
54   * @param array $optParams Optional parameters.
55   *
56   * @opt_param int pageSize The maximum number of custom channels to include in
57   * the response, used for paging. If unspecified, at most 10000 custom channels
58   * will be returned. The maximum value is 10000; values above 10000 will be
59   * coerced to 10000.
60   * @opt_param string pageToken A page token, received from a previous
61   * `ListCustomChannels` call. Provide this to retrieve the subsequent page. When
62   * paginating, all other parameters provided to `ListCustomChannels` must match
63   * the call that provided the page token.
64   * @return ListCustomChannelsResponse
65   */
66  public function listAccountsAdclientsCustomchannels($parent, $optParams = [])
67  {
68    $params = ['parent' => $parent];
69    $params = array_merge($params, $optParams);
70    return $this->call('list', [$params], ListCustomChannelsResponse::class);
71  }
72  /**
73   * Lists all the ad units available for a custom channel.
74   * (customchannels.listLinkedAdUnits)
75   *
76   * @param string $parent Required. The custom channel which owns the collection
77   * of ad units. Format:
78   * accounts/{account}/adclients/{adclient}/customchannels/{customchannel}
79   * @param array $optParams Optional parameters.
80   *
81   * @opt_param int pageSize The maximum number of ad units to include in the
82   * response, used for paging. If unspecified, at most 10000 ad units will be
83   * returned. The maximum value is 10000; values above 10000 will be coerced to
84   * 10000.
85   * @opt_param string pageToken A page token, received from a previous
86   * `ListLinkedAdUnits` call. Provide this to retrieve the subsequent page. When
87   * paginating, all other parameters provided to `ListLinkedAdUnits` must match
88   * the call that provided the page token.
89   * @return ListLinkedAdUnitsResponse
90   */
91  public function listLinkedAdUnits($parent, $optParams = [])
92  {
93    $params = ['parent' => $parent];
94    $params = array_merge($params, $optParams);
95    return $this->call('listLinkedAdUnits', [$params], ListLinkedAdUnitsResponse::class);
96  }
97}
98
99// Adding a class alias for backwards compatibility with the previous class name.
100class_alias(AccountsAdclientsCustomchannels::class, 'Google_Service_Adsense_Resource_AccountsAdclientsCustomchannels');
101