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\Site;
21use Google\Service\Dfareporting\SitesListResponse;
22
23/**
24 * The "sites" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $dfareportingService = new Google\Service\Dfareporting(...);
28 *   $sites = $dfareportingService->sites;
29 *  </code>
30 */
31class Sites extends \Google\Service\Resource
32{
33  /**
34   * Gets one site by ID. (sites.get)
35   *
36   * @param string $profileId User profile ID associated with this request.
37   * @param string $id Site ID.
38   * @param array $optParams Optional parameters.
39   * @return Site
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], Site::class);
46  }
47  /**
48   * Inserts a new site. (sites.insert)
49   *
50   * @param string $profileId User profile ID associated with this request.
51   * @param Site $postBody
52   * @param array $optParams Optional parameters.
53   * @return Site
54   */
55  public function insert($profileId, Site $postBody, $optParams = [])
56  {
57    $params = ['profileId' => $profileId, 'postBody' => $postBody];
58    $params = array_merge($params, $optParams);
59    return $this->call('insert', [$params], Site::class);
60  }
61  /**
62   * Retrieves a list of sites, possibly filtered. This method supports paging.
63   * (sites.listSites)
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 sites that accept
73   * publisher paid placements.
74   * @opt_param bool adWordsSite Select only AdWords sites.
75   * @opt_param bool approved Select only approved sites.
76   * @opt_param string campaignIds Select only sites with these campaign IDs.
77   * @opt_param string directorySiteIds Select only sites with these directory
78   * site IDs.
79   * @opt_param string ids Select only sites with these IDs.
80   * @opt_param int maxResults Maximum number of results to return.
81   * @opt_param string pageToken Value of the nextPageToken from the previous
82   * result page.
83   * @opt_param string searchString Allows searching for objects by name, ID or
84   * keyName. Wildcards (*) are allowed. For example, "site*2015" will return
85   * objects with names like "site June 2015", "site April 2015", or simply "site
86   * 2015". Most of the searches also add wildcards implicitly at the start and
87   * the end of the search string. For example, a search string of "site" will
88   * match objects with name "my site", "site 2015", or simply "site".
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 subaccountId Select only sites with this subaccount ID.
92   * @opt_param bool unmappedSite Select only sites that have not been mapped to a
93   * directory site.
94   * @return SitesListResponse
95   */
96  public function listSites($profileId, $optParams = [])
97  {
98    $params = ['profileId' => $profileId];
99    $params = array_merge($params, $optParams);
100    return $this->call('list', [$params], SitesListResponse::class);
101  }
102  /**
103   * Updates an existing site. This method supports patch semantics. (sites.patch)
104   *
105   * @param string $profileId User profile ID associated with this request.
106   * @param string $id Site ID.
107   * @param Site $postBody
108   * @param array $optParams Optional parameters.
109   * @return Site
110   */
111  public function patch($profileId, $id, Site $postBody, $optParams = [])
112  {
113    $params = ['profileId' => $profileId, 'id' => $id, 'postBody' => $postBody];
114    $params = array_merge($params, $optParams);
115    return $this->call('patch', [$params], Site::class);
116  }
117  /**
118   * Updates an existing site. (sites.update)
119   *
120   * @param string $profileId User profile ID associated with this request.
121   * @param Site $postBody
122   * @param array $optParams Optional parameters.
123   * @return Site
124   */
125  public function update($profileId, Site $postBody, $optParams = [])
126  {
127    $params = ['profileId' => $profileId, 'postBody' => $postBody];
128    $params = array_merge($params, $optParams);
129    return $this->call('update', [$params], Site::class);
130  }
131}
132
133// Adding a class alias for backwards compatibility with the previous class name.
134class_alias(Sites::class, 'Google_Service_Dfareporting_Resource_Sites');
135