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\DirectorySite;
|
---|
21 | use Google\Service\Dfareporting\DirectorySitesListResponse;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "directorySites" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $dfareportingService = new Google\Service\Dfareporting(...);
|
---|
28 | * $directorySites = $dfareportingService->directorySites;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class DirectorySites extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Gets one directory site by ID. (directorySites.get)
|
---|
35 | *
|
---|
36 | * @param string $profileId User profile ID associated with this request.
|
---|
37 | * @param string $id Directory site ID.
|
---|
38 | * @param array $optParams Optional parameters.
|
---|
39 | * @return DirectorySite
|
---|
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], DirectorySite::class);
|
---|
47 | }
|
---|
48 | /**
|
---|
49 | * Inserts a new directory site. (directorySites.insert)
|
---|
50 | *
|
---|
51 | * @param string $profileId User profile ID associated with this request.
|
---|
52 | * @param DirectorySite $postBody
|
---|
53 | * @param array $optParams Optional parameters.
|
---|
54 | * @return DirectorySite
|
---|
55 | * @throws \Google\Service\Exception
|
---|
56 | */
|
---|
57 | public function insert($profileId, DirectorySite $postBody, $optParams = [])
|
---|
58 | {
|
---|
59 | $params = ['profileId' => $profileId, 'postBody' => $postBody];
|
---|
60 | $params = array_merge($params, $optParams);
|
---|
61 | return $this->call('insert', [$params], DirectorySite::class);
|
---|
62 | }
|
---|
63 | /**
|
---|
64 | * Retrieves a list of directory sites, possibly filtered. This method supports
|
---|
65 | * paging. (directorySites.listDirectorySites)
|
---|
66 | *
|
---|
67 | * @param string $profileId User profile ID associated with this request.
|
---|
68 | * @param array $optParams Optional parameters.
|
---|
69 | *
|
---|
70 | * @opt_param bool acceptsInStreamVideoPlacements This search filter is no
|
---|
71 | * longer supported and will have no effect on the results returned.
|
---|
72 | * @opt_param bool acceptsInterstitialPlacements This search filter is no longer
|
---|
73 | * supported and will have no effect on the results returned.
|
---|
74 | * @opt_param bool acceptsPublisherPaidPlacements Select only directory sites
|
---|
75 | * that accept publisher paid placements. This field can be left blank.
|
---|
76 | * @opt_param bool active Select only active directory sites. Leave blank to
|
---|
77 | * retrieve both active and inactive directory sites.
|
---|
78 | * @opt_param string dfpNetworkCode Select only directory sites with this Ad
|
---|
79 | * Manager network code.
|
---|
80 | * @opt_param string ids Select only directory sites 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 searchString Allows searching for objects by name, ID or
|
---|
85 | * URL. Wildcards (*) are allowed. For example, "directory site*2015" will
|
---|
86 | * return objects with names like "directory site June 2015", "directory site
|
---|
87 | * April 2015", or simply "directory site 2015". Most of the searches also add
|
---|
88 | * wildcards implicitly at the start and the end of the search string. For
|
---|
89 | * example, a search string of "directory site" will match objects with name "my
|
---|
90 | * directory site", "directory site 2015" or simply, "directory site".
|
---|
91 | * @opt_param string sortField Field by which to sort the list.
|
---|
92 | * @opt_param string sortOrder Order of sorted results.
|
---|
93 | * @return DirectorySitesListResponse
|
---|
94 | * @throws \Google\Service\Exception
|
---|
95 | */
|
---|
96 | public function listDirectorySites($profileId, $optParams = [])
|
---|
97 | {
|
---|
98 | $params = ['profileId' => $profileId];
|
---|
99 | $params = array_merge($params, $optParams);
|
---|
100 | return $this->call('list', [$params], DirectorySitesListResponse::class);
|
---|
101 | }
|
---|
102 | }
|
---|
103 |
|
---|
104 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
105 | class_alias(DirectorySites::class, 'Google_Service_Dfareporting_Resource_DirectorySites');
|
---|