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\CustomChannel; 21use Google\Service\AdSenseHost\CustomChannels as CustomChannelsModel; 22 23/** 24 * The "customchannels" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $adsensehostService = new Google\Service\AdSenseHost(...); 28 * $customchannels = $adsensehostService->customchannels; 29 * </code> 30 */ 31class Customchannels extends \Google\Service\Resource 32{ 33 /** 34 * Delete a specific custom channel from the host AdSense account. 35 * (customchannels.delete) 36 * 37 * @param string $adClientId Ad client from which to delete the custom channel. 38 * @param string $customChannelId Custom channel to delete. 39 * @param array $optParams Optional parameters. 40 * @return CustomChannel 41 */ 42 public function delete($adClientId, $customChannelId, $optParams = []) 43 { 44 $params = ['adClientId' => $adClientId, 'customChannelId' => $customChannelId]; 45 $params = array_merge($params, $optParams); 46 return $this->call('delete', [$params], CustomChannel::class); 47 } 48 /** 49 * Get a specific custom channel from the host AdSense account. 50 * (customchannels.get) 51 * 52 * @param string $adClientId Ad client from which to get the custom channel. 53 * @param string $customChannelId Custom channel to get. 54 * @param array $optParams Optional parameters. 55 * @return CustomChannel 56 */ 57 public function get($adClientId, $customChannelId, $optParams = []) 58 { 59 $params = ['adClientId' => $adClientId, 'customChannelId' => $customChannelId]; 60 $params = array_merge($params, $optParams); 61 return $this->call('get', [$params], CustomChannel::class); 62 } 63 /** 64 * Add a new custom channel to the host AdSense account. (customchannels.insert) 65 * 66 * @param string $adClientId Ad client to which the new custom channel will be 67 * added. 68 * @param CustomChannel $postBody 69 * @param array $optParams Optional parameters. 70 * @return CustomChannel 71 */ 72 public function insert($adClientId, CustomChannel $postBody, $optParams = []) 73 { 74 $params = ['adClientId' => $adClientId, 'postBody' => $postBody]; 75 $params = array_merge($params, $optParams); 76 return $this->call('insert', [$params], CustomChannel::class); 77 } 78 /** 79 * List all host custom channels in this AdSense account. 80 * (customchannels.listCustomchannels) 81 * 82 * @param string $adClientId Ad client for which to list custom channels. 83 * @param array $optParams Optional parameters. 84 * 85 * @opt_param string maxResults The maximum number of custom channels to include 86 * in the response, used for paging. 87 * @opt_param string pageToken A continuation token, used to page through custom 88 * channels. To retrieve the next page, set this parameter to the value of 89 * "nextPageToken" from the previous response. 90 * @return CustomChannelsModel 91 */ 92 public function listCustomchannels($adClientId, $optParams = []) 93 { 94 $params = ['adClientId' => $adClientId]; 95 $params = array_merge($params, $optParams); 96 return $this->call('list', [$params], CustomChannelsModel::class); 97 } 98 /** 99 * Update a custom channel in the host AdSense account. This method supports 100 * patch semantics. (customchannels.patch) 101 * 102 * @param string $adClientId Ad client in which the custom channel will be 103 * updated. 104 * @param string $customChannelId Custom channel to get. 105 * @param CustomChannel $postBody 106 * @param array $optParams Optional parameters. 107 * @return CustomChannel 108 */ 109 public function patch($adClientId, $customChannelId, CustomChannel $postBody, $optParams = []) 110 { 111 $params = ['adClientId' => $adClientId, 'customChannelId' => $customChannelId, 'postBody' => $postBody]; 112 $params = array_merge($params, $optParams); 113 return $this->call('patch', [$params], CustomChannel::class); 114 } 115 /** 116 * Update a custom channel in the host AdSense account. (customchannels.update) 117 * 118 * @param string $adClientId Ad client in which the custom channel will be 119 * updated. 120 * @param CustomChannel $postBody 121 * @param array $optParams Optional parameters. 122 * @return CustomChannel 123 */ 124 public function update($adClientId, CustomChannel $postBody, $optParams = []) 125 { 126 $params = ['adClientId' => $adClientId, 'postBody' => $postBody]; 127 $params = array_merge($params, $optParams); 128 return $this->call('update', [$params], CustomChannel::class); 129 } 130} 131 132// Adding a class alias for backwards compatibility with the previous class name. 133class_alias(Customchannels::class, 'Google_Service_AdSenseHost_Resource_Customchannels'); 134