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