[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\Dfareporting\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Dfareporting\Creative;
|
---|
| 21 | use Google\Service\Dfareporting\CreativesListResponse;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * The "creatives" collection of methods.
|
---|
| 25 | * Typical usage is:
|
---|
| 26 | * <code>
|
---|
| 27 | * $dfareportingService = new Google\Service\Dfareporting(...);
|
---|
| 28 | * $creatives = $dfareportingService->creatives;
|
---|
| 29 | * </code>
|
---|
| 30 | */
|
---|
| 31 | class Creatives extends \Google\Service\Resource
|
---|
| 32 | {
|
---|
| 33 | /**
|
---|
| 34 | * Gets one creative by ID. (creatives.get)
|
---|
| 35 | *
|
---|
| 36 | * @param string $profileId User profile ID associated with this request.
|
---|
| 37 | * @param string $id Creative ID.
|
---|
| 38 | * @param array $optParams Optional parameters.
|
---|
| 39 | * @return Creative
|
---|
| 40 | * @throws \Google\Service\Exception
|
---|
| 41 | */
|
---|
| 42 | public function get($profileId, $id, $optParams = [])
|
---|
| 43 | {
|
---|
| 44 | $params = ['profileId' => $profileId, 'id' => $id];
|
---|
| 45 | $params = array_merge($params, $optParams);
|
---|
| 46 | return $this->call('get', [$params], Creative::class);
|
---|
| 47 | }
|
---|
| 48 | /**
|
---|
| 49 | * Inserts a new creative. (creatives.insert)
|
---|
| 50 | *
|
---|
| 51 | * @param string $profileId User profile ID associated with this request.
|
---|
| 52 | * @param Creative $postBody
|
---|
| 53 | * @param array $optParams Optional parameters.
|
---|
| 54 | * @return Creative
|
---|
| 55 | * @throws \Google\Service\Exception
|
---|
| 56 | */
|
---|
| 57 | public function insert($profileId, Creative $postBody, $optParams = [])
|
---|
| 58 | {
|
---|
| 59 | $params = ['profileId' => $profileId, 'postBody' => $postBody];
|
---|
| 60 | $params = array_merge($params, $optParams);
|
---|
| 61 | return $this->call('insert', [$params], Creative::class);
|
---|
| 62 | }
|
---|
| 63 | /**
|
---|
| 64 | * Retrieves a list of creatives, possibly filtered. This method supports
|
---|
| 65 | * paging. (creatives.listCreatives)
|
---|
| 66 | *
|
---|
| 67 | * @param string $profileId User profile ID associated with this request.
|
---|
| 68 | * @param array $optParams Optional parameters.
|
---|
| 69 | *
|
---|
| 70 | * @opt_param bool active Select only active creatives. Leave blank to select
|
---|
| 71 | * active and inactive creatives.
|
---|
| 72 | * @opt_param string advertiserId Select only creatives with this advertiser ID.
|
---|
| 73 | * @opt_param bool archived Select only archived creatives. Leave blank to
|
---|
| 74 | * select archived and unarchived creatives.
|
---|
| 75 | * @opt_param string campaignId Select only creatives with this campaign ID.
|
---|
| 76 | * @opt_param string companionCreativeIds Select only in-stream video creatives
|
---|
| 77 | * with these companion IDs.
|
---|
| 78 | * @opt_param string creativeFieldIds Select only creatives with these creative
|
---|
| 79 | * field IDs.
|
---|
| 80 | * @opt_param string ids Select only creatives with these IDs.
|
---|
| 81 | * @opt_param int maxResults Maximum number of results to return.
|
---|
| 82 | * @opt_param string pageToken Value of the nextPageToken from the previous
|
---|
| 83 | * result page.
|
---|
| 84 | * @opt_param string renderingIds Select only creatives with these rendering
|
---|
| 85 | * IDs.
|
---|
| 86 | * @opt_param string searchString Allows searching for objects by name or ID.
|
---|
| 87 | * Wildcards (*) are allowed. For example, "creative*2015" will return objects
|
---|
| 88 | * with names like "creative June 2015", "creative April 2015", or simply
|
---|
| 89 | * "creative 2015". Most of the searches also add wildcards implicitly at the
|
---|
| 90 | * start and the end of the search string. For example, a search string of
|
---|
| 91 | * "creative" will match objects with name "my creative", "creative 2015", or
|
---|
| 92 | * simply "creative".
|
---|
| 93 | * @opt_param string sizeIds Select only creatives with these size IDs.
|
---|
| 94 | * @opt_param string sortField Field by which to sort the list.
|
---|
| 95 | * @opt_param string sortOrder Order of sorted results.
|
---|
| 96 | * @opt_param string studioCreativeId Select only creatives corresponding to
|
---|
| 97 | * this Studio creative ID.
|
---|
| 98 | * @opt_param string types Select only creatives with these creative types.
|
---|
| 99 | * @return CreativesListResponse
|
---|
| 100 | * @throws \Google\Service\Exception
|
---|
| 101 | */
|
---|
| 102 | public function listCreatives($profileId, $optParams = [])
|
---|
| 103 | {
|
---|
| 104 | $params = ['profileId' => $profileId];
|
---|
| 105 | $params = array_merge($params, $optParams);
|
---|
| 106 | return $this->call('list', [$params], CreativesListResponse::class);
|
---|
| 107 | }
|
---|
| 108 | /**
|
---|
| 109 | * Updates an existing creative. This method supports patch semantics.
|
---|
| 110 | * (creatives.patch)
|
---|
| 111 | *
|
---|
| 112 | * @param string $profileId User profile ID associated with this request.
|
---|
| 113 | * @param string $id Required. Creative ID.
|
---|
| 114 | * @param Creative $postBody
|
---|
| 115 | * @param array $optParams Optional parameters.
|
---|
| 116 | * @return Creative
|
---|
| 117 | * @throws \Google\Service\Exception
|
---|
| 118 | */
|
---|
| 119 | public function patch($profileId, $id, Creative $postBody, $optParams = [])
|
---|
| 120 | {
|
---|
| 121 | $params = ['profileId' => $profileId, 'id' => $id, 'postBody' => $postBody];
|
---|
| 122 | $params = array_merge($params, $optParams);
|
---|
| 123 | return $this->call('patch', [$params], Creative::class);
|
---|
| 124 | }
|
---|
| 125 | /**
|
---|
| 126 | * Updates an existing creative. (creatives.update)
|
---|
| 127 | *
|
---|
| 128 | * @param string $profileId User profile ID associated with this request.
|
---|
| 129 | * @param Creative $postBody
|
---|
| 130 | * @param array $optParams Optional parameters.
|
---|
| 131 | * @return Creative
|
---|
| 132 | * @throws \Google\Service\Exception
|
---|
| 133 | */
|
---|
| 134 | public function update($profileId, Creative $postBody, $optParams = [])
|
---|
| 135 | {
|
---|
| 136 | $params = ['profileId' => $profileId, 'postBody' => $postBody];
|
---|
| 137 | $params = array_merge($params, $optParams);
|
---|
| 138 | return $this->call('update', [$params], Creative::class);
|
---|
| 139 | }
|
---|
| 140 | }
|
---|
| 141 |
|
---|
| 142 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 143 | class_alias(Creatives::class, 'Google_Service_Dfareporting_Resource_Creatives');
|
---|