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