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/** 19 * The "channels" collection of methods. 20 * Typical usage is: 21 * <code> 22 * $displayvideoService = new Google_Service_DisplayVideo(...); 23 * $channels = $displayvideoService->channels; 24 * </code> 25 */ 26class Google_Service_DisplayVideo_Resource_AdvertisersChannels extends Google_Service_Resource 27{ 28 /** 29 * Creates a new channel. Returns the newly created channel if successful. 30 * (channels.create) 31 * 32 * @param string $advertiserId The ID of the advertiser that owns the created 33 * channel. 34 * @param Google_Service_DisplayVideo_Channel $postBody 35 * @param array $optParams Optional parameters. 36 * 37 * @opt_param string partnerId The ID of the partner that owns the created 38 * channel. 39 * @return Google_Service_DisplayVideo_Channel 40 */ 41 public function create($advertiserId, Google_Service_DisplayVideo_Channel $postBody, $optParams = array()) 42 { 43 $params = array('advertiserId' => $advertiserId, 'postBody' => $postBody); 44 $params = array_merge($params, $optParams); 45 return $this->call('create', array($params), "Google_Service_DisplayVideo_Channel"); 46 } 47 /** 48 * Gets a channel for a partner or advertiser. (channels.get) 49 * 50 * @param string $advertiserId The ID of the advertiser that owns the fetched 51 * channel. 52 * @param string $channelId Required. The ID of the channel to fetch. 53 * @param array $optParams Optional parameters. 54 * 55 * @opt_param string partnerId The ID of the partner that owns the fetched 56 * channel. 57 * @return Google_Service_DisplayVideo_Channel 58 */ 59 public function get($advertiserId, $channelId, $optParams = array()) 60 { 61 $params = array('advertiserId' => $advertiserId, 'channelId' => $channelId); 62 $params = array_merge($params, $optParams); 63 return $this->call('get', array($params), "Google_Service_DisplayVideo_Channel"); 64 } 65 /** 66 * Lists channels for a partner or advertiser. 67 * (channels.listAdvertisersChannels) 68 * 69 * @param string $advertiserId The ID of the advertiser that owns the channels. 70 * @param array $optParams Optional parameters. 71 * 72 * @opt_param string filter Allows filtering by channel fields. Supported 73 * syntax: * Filter expressions for channel currently can only contain at most 74 * one * restriction. * A restriction has the form of `{field} {operator} 75 * {value}`. * The operator must be `CONTAINS (:)`. * Supported fields: - 76 * `displayName` Examples: * All channels for which the display name contains 77 * "google": `displayName : "google"`. The length of this field should be no 78 * more than 500 characters. 79 * @opt_param string orderBy Field by which to sort the list. Acceptable values 80 * are: * `displayName` (default) * `channelId` The default sorting order is 81 * ascending. To specify descending order for a field, a suffix " desc" should 82 * be added to the field name. Example: `displayName desc`. 83 * @opt_param int pageSize Requested page size. Must be between `1` and `100`. 84 * If unspecified will default to `100`. Returns error code `INVALID_ARGUMENT` 85 * if an invalid value is specified. 86 * @opt_param string pageToken A token identifying a page of results the server 87 * should return. Typically, this is the value of next_page_token returned from 88 * the previous call to `ListChannels` method. If not specified, the first page 89 * of results will be returned. 90 * @opt_param string partnerId The ID of the partner that owns the channels. 91 * @return Google_Service_DisplayVideo_ListChannelsResponse 92 */ 93 public function listAdvertisersChannels($advertiserId, $optParams = array()) 94 { 95 $params = array('advertiserId' => $advertiserId); 96 $params = array_merge($params, $optParams); 97 return $this->call('list', array($params), "Google_Service_DisplayVideo_ListChannelsResponse"); 98 } 99 /** 100 * Updates a channel. Returns the updated channel if successful. 101 * (channels.patch) 102 * 103 * @param string $advertiserId The ID of the advertiser that owns the created 104 * channel. 105 * @param string $channelId Output only. The unique ID of the channel. Assigned 106 * by the system. 107 * @param Google_Service_DisplayVideo_Channel $postBody 108 * @param array $optParams Optional parameters. 109 * 110 * @opt_param string partnerId The ID of the partner that owns the created 111 * channel. 112 * @opt_param string updateMask Required. The mask to control which fields to 113 * update. 114 * @return Google_Service_DisplayVideo_Channel 115 */ 116 public function patch($advertiserId, $channelId, Google_Service_DisplayVideo_Channel $postBody, $optParams = array()) 117 { 118 $params = array('advertiserId' => $advertiserId, 'channelId' => $channelId, 'postBody' => $postBody); 119 $params = array_merge($params, $optParams); 120 return $this->call('patch', array($params), "Google_Service_DisplayVideo_Channel"); 121 } 122} 123