[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\Advertiser;
|
---|
| 21 | use Google\Service\Dfareporting\AdvertisersListResponse;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * The "advertisers" collection of methods.
|
---|
| 25 | * Typical usage is:
|
---|
| 26 | * <code>
|
---|
| 27 | * $dfareportingService = new Google\Service\Dfareporting(...);
|
---|
| 28 | * $advertisers = $dfareportingService->advertisers;
|
---|
| 29 | * </code>
|
---|
| 30 | */
|
---|
| 31 | class Advertisers extends \Google\Service\Resource
|
---|
| 32 | {
|
---|
| 33 | /**
|
---|
| 34 | * Gets one advertiser by ID. (advertisers.get)
|
---|
| 35 | *
|
---|
| 36 | * @param string $profileId User profile ID associated with this request.
|
---|
| 37 | * @param string $id Advertiser ID.
|
---|
| 38 | * @param array $optParams Optional parameters.
|
---|
| 39 | * @return Advertiser
|
---|
| 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], Advertiser::class);
|
---|
| 47 | }
|
---|
| 48 | /**
|
---|
| 49 | * Inserts a new advertiser. (advertisers.insert)
|
---|
| 50 | *
|
---|
| 51 | * @param string $profileId User profile ID associated with this request.
|
---|
| 52 | * @param Advertiser $postBody
|
---|
| 53 | * @param array $optParams Optional parameters.
|
---|
| 54 | * @return Advertiser
|
---|
| 55 | * @throws \Google\Service\Exception
|
---|
| 56 | */
|
---|
| 57 | public function insert($profileId, Advertiser $postBody, $optParams = [])
|
---|
| 58 | {
|
---|
| 59 | $params = ['profileId' => $profileId, 'postBody' => $postBody];
|
---|
| 60 | $params = array_merge($params, $optParams);
|
---|
| 61 | return $this->call('insert', [$params], Advertiser::class);
|
---|
| 62 | }
|
---|
| 63 | /**
|
---|
| 64 | * Retrieves a list of advertisers, possibly filtered. This method supports
|
---|
| 65 | * paging. (advertisers.listAdvertisers)
|
---|
| 66 | *
|
---|
| 67 | * @param string $profileId User profile ID associated with this request.
|
---|
| 68 | * @param array $optParams Optional parameters.
|
---|
| 69 | *
|
---|
| 70 | * @opt_param string advertiserGroupIds Select only advertisers with these
|
---|
| 71 | * advertiser group IDs.
|
---|
| 72 | * @opt_param string floodlightConfigurationIds Select only advertisers with
|
---|
| 73 | * these floodlight configuration IDs.
|
---|
| 74 | * @opt_param string ids Select only advertisers with these IDs.
|
---|
| 75 | * @opt_param bool includeAdvertisersWithoutGroupsOnly Select only advertisers
|
---|
| 76 | * which do not belong to any advertiser group.
|
---|
| 77 | * @opt_param int maxResults Maximum number of results to return.
|
---|
| 78 | * @opt_param bool onlyParent Select only advertisers which use another
|
---|
| 79 | * advertiser's floodlight configuration.
|
---|
| 80 | * @opt_param string pageToken Value of the nextPageToken from the previous
|
---|
| 81 | * result page.
|
---|
| 82 | * @opt_param string searchString Allows searching for objects by name or ID.
|
---|
| 83 | * Wildcards (*) are allowed. For example, "advertiser*2015" will return objects
|
---|
| 84 | * with names like "advertiser June 2015", "advertiser April 2015", or simply
|
---|
| 85 | * "advertiser 2015". Most of the searches also add wildcards implicitly at the
|
---|
| 86 | * start and the end of the search string. For example, a search string of
|
---|
| 87 | * "advertiser" will match objects with name "my advertiser", "advertiser 2015",
|
---|
| 88 | * or simply "advertiser" .
|
---|
| 89 | * @opt_param string sortField Field by which to sort the list.
|
---|
| 90 | * @opt_param string sortOrder Order of sorted results.
|
---|
| 91 | * @opt_param string status Select only advertisers with the specified status.
|
---|
| 92 | * @opt_param string subaccountId Select only advertisers with these subaccount
|
---|
| 93 | * IDs.
|
---|
| 94 | * @return AdvertisersListResponse
|
---|
| 95 | * @throws \Google\Service\Exception
|
---|
| 96 | */
|
---|
| 97 | public function listAdvertisers($profileId, $optParams = [])
|
---|
| 98 | {
|
---|
| 99 | $params = ['profileId' => $profileId];
|
---|
| 100 | $params = array_merge($params, $optParams);
|
---|
| 101 | return $this->call('list', [$params], AdvertisersListResponse::class);
|
---|
| 102 | }
|
---|
| 103 | /**
|
---|
| 104 | * Updates an existing advertiser. This method supports patch semantics.
|
---|
| 105 | * (advertisers.patch)
|
---|
| 106 | *
|
---|
| 107 | * @param string $profileId User profile ID associated with this request.
|
---|
| 108 | * @param string $id Required. Advertiser ID.
|
---|
| 109 | * @param Advertiser $postBody
|
---|
| 110 | * @param array $optParams Optional parameters.
|
---|
| 111 | * @return Advertiser
|
---|
| 112 | * @throws \Google\Service\Exception
|
---|
| 113 | */
|
---|
| 114 | public function patch($profileId, $id, Advertiser $postBody, $optParams = [])
|
---|
| 115 | {
|
---|
| 116 | $params = ['profileId' => $profileId, 'id' => $id, 'postBody' => $postBody];
|
---|
| 117 | $params = array_merge($params, $optParams);
|
---|
| 118 | return $this->call('patch', [$params], Advertiser::class);
|
---|
| 119 | }
|
---|
| 120 | /**
|
---|
| 121 | * Updates an existing advertiser. (advertisers.update)
|
---|
| 122 | *
|
---|
| 123 | * @param string $profileId User profile ID associated with this request.
|
---|
| 124 | * @param Advertiser $postBody
|
---|
| 125 | * @param array $optParams Optional parameters.
|
---|
| 126 | * @return Advertiser
|
---|
| 127 | * @throws \Google\Service\Exception
|
---|
| 128 | */
|
---|
| 129 | public function update($profileId, Advertiser $postBody, $optParams = [])
|
---|
| 130 | {
|
---|
| 131 | $params = ['profileId' => $profileId, 'postBody' => $postBody];
|
---|
| 132 | $params = array_merge($params, $optParams);
|
---|
| 133 | return $this->call('update', [$params], Advertiser::class);
|
---|
| 134 | }
|
---|
| 135 | }
|
---|
| 136 |
|
---|
| 137 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 138 | class_alias(Advertisers::class, 'Google_Service_Dfareporting_Resource_Advertisers');
|
---|