[e3d4e0a] | 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\Adsense\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Adsense\AdsenseEmpty;
|
---|
| 21 | use Google\Service\Adsense\CustomChannel;
|
---|
| 22 | use Google\Service\Adsense\ListCustomChannelsResponse;
|
---|
| 23 | use Google\Service\Adsense\ListLinkedAdUnitsResponse;
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * The "customchannels" collection of methods.
|
---|
| 27 | * Typical usage is:
|
---|
| 28 | * <code>
|
---|
| 29 | * $adsenseService = new Google\Service\Adsense(...);
|
---|
| 30 | * $customchannels = $adsenseService->accounts_adclients_customchannels;
|
---|
| 31 | * </code>
|
---|
| 32 | */
|
---|
| 33 | class AccountsAdclientsCustomchannels extends \Google\Service\Resource
|
---|
| 34 | {
|
---|
| 35 | /**
|
---|
| 36 | * Creates a custom channel. This method can be called only by a restricted set
|
---|
| 37 | * of projects, which are usually owned by [AdSense for
|
---|
| 38 | * Platforms](https://developers.google.com/adsense/platforms/) publishers.
|
---|
| 39 | * Contact your account manager if you need to use this method.
|
---|
| 40 | * (customchannels.create)
|
---|
| 41 | *
|
---|
| 42 | * @param string $parent Required. The ad client to create a custom channel
|
---|
| 43 | * under. Format: accounts/{account}/adclients/{adclient}
|
---|
| 44 | * @param CustomChannel $postBody
|
---|
| 45 | * @param array $optParams Optional parameters.
|
---|
| 46 | * @return CustomChannel
|
---|
| 47 | * @throws \Google\Service\Exception
|
---|
| 48 | */
|
---|
| 49 | public function create($parent, CustomChannel $postBody, $optParams = [])
|
---|
| 50 | {
|
---|
| 51 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 52 | $params = array_merge($params, $optParams);
|
---|
| 53 | return $this->call('create', [$params], CustomChannel::class);
|
---|
| 54 | }
|
---|
| 55 | /**
|
---|
| 56 | * Deletes a custom channel. This method can be called only by a restricted set
|
---|
| 57 | * of projects, which are usually owned by [AdSense for
|
---|
| 58 | * Platforms](https://developers.google.com/adsense/platforms/) publishers.
|
---|
| 59 | * Contact your account manager if you need to use this method.
|
---|
| 60 | * (customchannels.delete)
|
---|
| 61 | *
|
---|
| 62 | * @param string $name Required. Name of the custom channel to delete. Format:
|
---|
| 63 | * accounts/{account}/adclients/{adclient}/customchannels/{customchannel}
|
---|
| 64 | * @param array $optParams Optional parameters.
|
---|
| 65 | * @return AdsenseEmpty
|
---|
| 66 | * @throws \Google\Service\Exception
|
---|
| 67 | */
|
---|
| 68 | public function delete($name, $optParams = [])
|
---|
| 69 | {
|
---|
| 70 | $params = ['name' => $name];
|
---|
| 71 | $params = array_merge($params, $optParams);
|
---|
| 72 | return $this->call('delete', [$params], AdsenseEmpty::class);
|
---|
| 73 | }
|
---|
| 74 | /**
|
---|
| 75 | * Gets information about the selected custom channel. (customchannels.get)
|
---|
| 76 | *
|
---|
| 77 | * @param string $name Required. Name of the custom channel. Format:
|
---|
| 78 | * accounts/{account}/adclients/{adclient}/customchannels/{customchannel}
|
---|
| 79 | * @param array $optParams Optional parameters.
|
---|
| 80 | * @return CustomChannel
|
---|
| 81 | * @throws \Google\Service\Exception
|
---|
| 82 | */
|
---|
| 83 | public function get($name, $optParams = [])
|
---|
| 84 | {
|
---|
| 85 | $params = ['name' => $name];
|
---|
| 86 | $params = array_merge($params, $optParams);
|
---|
| 87 | return $this->call('get', [$params], CustomChannel::class);
|
---|
| 88 | }
|
---|
| 89 | /**
|
---|
| 90 | * Lists all the custom channels available in an ad client.
|
---|
| 91 | * (customchannels.listAccountsAdclientsCustomchannels)
|
---|
| 92 | *
|
---|
| 93 | * @param string $parent Required. The ad client which owns the collection of
|
---|
| 94 | * custom channels. Format: accounts/{account}/adclients/{adclient}
|
---|
| 95 | * @param array $optParams Optional parameters.
|
---|
| 96 | *
|
---|
| 97 | * @opt_param int pageSize The maximum number of custom channels to include in
|
---|
| 98 | * the response, used for paging. If unspecified, at most 10000 custom channels
|
---|
| 99 | * will be returned. The maximum value is 10000; values above 10000 will be
|
---|
| 100 | * coerced to 10000.
|
---|
| 101 | * @opt_param string pageToken A page token, received from a previous
|
---|
| 102 | * `ListCustomChannels` call. Provide this to retrieve the subsequent page. When
|
---|
| 103 | * paginating, all other parameters provided to `ListCustomChannels` must match
|
---|
| 104 | * the call that provided the page token.
|
---|
| 105 | * @return ListCustomChannelsResponse
|
---|
| 106 | * @throws \Google\Service\Exception
|
---|
| 107 | */
|
---|
| 108 | public function listAccountsAdclientsCustomchannels($parent, $optParams = [])
|
---|
| 109 | {
|
---|
| 110 | $params = ['parent' => $parent];
|
---|
| 111 | $params = array_merge($params, $optParams);
|
---|
| 112 | return $this->call('list', [$params], ListCustomChannelsResponse::class);
|
---|
| 113 | }
|
---|
| 114 | /**
|
---|
| 115 | * Lists all the ad units available for a custom channel.
|
---|
| 116 | * (customchannels.listLinkedAdUnits)
|
---|
| 117 | *
|
---|
| 118 | * @param string $parent Required. The custom channel which owns the collection
|
---|
| 119 | * of ad units. Format:
|
---|
| 120 | * accounts/{account}/adclients/{adclient}/customchannels/{customchannel}
|
---|
| 121 | * @param array $optParams Optional parameters.
|
---|
| 122 | *
|
---|
| 123 | * @opt_param int pageSize The maximum number of ad units to include in the
|
---|
| 124 | * response, used for paging. If unspecified, at most 10000 ad units will be
|
---|
| 125 | * returned. The maximum value is 10000; values above 10000 will be coerced to
|
---|
| 126 | * 10000.
|
---|
| 127 | * @opt_param string pageToken A page token, received from a previous
|
---|
| 128 | * `ListLinkedAdUnits` call. Provide this to retrieve the subsequent page. When
|
---|
| 129 | * paginating, all other parameters provided to `ListLinkedAdUnits` must match
|
---|
| 130 | * the call that provided the page token.
|
---|
| 131 | * @return ListLinkedAdUnitsResponse
|
---|
| 132 | * @throws \Google\Service\Exception
|
---|
| 133 | */
|
---|
| 134 | public function listLinkedAdUnits($parent, $optParams = [])
|
---|
| 135 | {
|
---|
| 136 | $params = ['parent' => $parent];
|
---|
| 137 | $params = array_merge($params, $optParams);
|
---|
| 138 | return $this->call('listLinkedAdUnits', [$params], ListLinkedAdUnitsResponse::class);
|
---|
| 139 | }
|
---|
| 140 | /**
|
---|
| 141 | * Updates a custom channel. This method can be called only by a restricted set
|
---|
| 142 | * of projects, which are usually owned by [AdSense for
|
---|
| 143 | * Platforms](https://developers.google.com/adsense/platforms/) publishers.
|
---|
| 144 | * Contact your account manager if you need to use this method.
|
---|
| 145 | * (customchannels.patch)
|
---|
| 146 | *
|
---|
| 147 | * @param string $name Output only. Resource name of the custom channel. Format:
|
---|
| 148 | * accounts/{account}/adclients/{adclient}/customchannels/{customchannel}
|
---|
| 149 | * @param CustomChannel $postBody
|
---|
| 150 | * @param array $optParams Optional parameters.
|
---|
| 151 | *
|
---|
| 152 | * @opt_param string updateMask The list of fields to update. If empty, a full
|
---|
| 153 | * update is performed.
|
---|
| 154 | * @return CustomChannel
|
---|
| 155 | * @throws \Google\Service\Exception
|
---|
| 156 | */
|
---|
| 157 | public function patch($name, CustomChannel $postBody, $optParams = [])
|
---|
| 158 | {
|
---|
| 159 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 160 | $params = array_merge($params, $optParams);
|
---|
| 161 | return $this->call('patch', [$params], CustomChannel::class);
|
---|
| 162 | }
|
---|
| 163 | }
|
---|
| 164 |
|
---|
| 165 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 166 | class_alias(AccountsAdclientsCustomchannels::class, 'Google_Service_Adsense_Resource_AccountsAdclientsCustomchannels');
|
---|