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\AdSenseHost\Resource;
19
20use Google\Service\AdSenseHost\UrlChannel;
21use Google\Service\AdSenseHost\UrlChannels as UrlChannelsModel;
22
23/**
24 * The "urlchannels" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $adsensehostService = new Google\Service\AdSenseHost(...);
28 *   $urlchannels = $adsensehostService->urlchannels;
29 *  </code>
30 */
31class Urlchannels extends \Google\Service\Resource
32{
33  /**
34   * Delete a URL channel from the host AdSense account. (urlchannels.delete)
35   *
36   * @param string $adClientId Ad client from which to delete the URL channel.
37   * @param string $urlChannelId URL channel to delete.
38   * @param array $optParams Optional parameters.
39   * @return UrlChannel
40   */
41  public function delete($adClientId, $urlChannelId, $optParams = [])
42  {
43    $params = ['adClientId' => $adClientId, 'urlChannelId' => $urlChannelId];
44    $params = array_merge($params, $optParams);
45    return $this->call('delete', [$params], UrlChannel::class);
46  }
47  /**
48   * Add a new URL channel to the host AdSense account. (urlchannels.insert)
49   *
50   * @param string $adClientId Ad client to which the new URL channel will be
51   * added.
52   * @param UrlChannel $postBody
53   * @param array $optParams Optional parameters.
54   * @return UrlChannel
55   */
56  public function insert($adClientId, UrlChannel $postBody, $optParams = [])
57  {
58    $params = ['adClientId' => $adClientId, 'postBody' => $postBody];
59    $params = array_merge($params, $optParams);
60    return $this->call('insert', [$params], UrlChannel::class);
61  }
62  /**
63   * List all host URL channels in the host AdSense account.
64   * (urlchannels.listUrlchannels)
65   *
66   * @param string $adClientId Ad client for which to list URL channels.
67   * @param array $optParams Optional parameters.
68   *
69   * @opt_param string maxResults The maximum number of URL channels to include in
70   * the response, used for paging.
71   * @opt_param string pageToken A continuation token, used to page through URL
72   * channels. To retrieve the next page, set this parameter to the value of
73   * "nextPageToken" from the previous response.
74   * @return UrlChannelsModel
75   */
76  public function listUrlchannels($adClientId, $optParams = [])
77  {
78    $params = ['adClientId' => $adClientId];
79    $params = array_merge($params, $optParams);
80    return $this->call('list', [$params], UrlChannelsModel::class);
81  }
82}
83
84// Adding a class alias for backwards compatibility with the previous class name.
85class_alias(Urlchannels::class, 'Google_Service_AdSenseHost_Resource_Urlchannels');
86