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