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