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\AdExchangeBuyer\Resource;
19
20use Google\Service\AdExchangeBuyer\PretargetingConfig as PretargetingConfigModel;
21use Google\Service\AdExchangeBuyer\PretargetingConfigList;
22
23/**
24 * The "pretargetingConfig" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $adexchangebuyerService = new Google\Service\AdExchangeBuyer(...);
28 *   $pretargetingConfig = $adexchangebuyerService->pretargetingConfig;
29 *  </code>
30 */
31class PretargetingConfig extends \Google\Service\Resource
32{
33  /**
34   * Deletes an existing pretargeting config. (pretargetingConfig.delete)
35   *
36   * @param string $accountId The account id to delete the pretargeting config
37   * for.
38   * @param string $configId The specific id of the configuration to delete.
39   * @param array $optParams Optional parameters.
40   */
41  public function delete($accountId, $configId, $optParams = [])
42  {
43    $params = ['accountId' => $accountId, 'configId' => $configId];
44    $params = array_merge($params, $optParams);
45    return $this->call('delete', [$params]);
46  }
47  /**
48   * Gets a specific pretargeting configuration (pretargetingConfig.get)
49   *
50   * @param string $accountId The account id to get the pretargeting config for.
51   * @param string $configId The specific id of the configuration to retrieve.
52   * @param array $optParams Optional parameters.
53   * @return PretargetingConfigModel
54   */
55  public function get($accountId, $configId, $optParams = [])
56  {
57    $params = ['accountId' => $accountId, 'configId' => $configId];
58    $params = array_merge($params, $optParams);
59    return $this->call('get', [$params], PretargetingConfigModel::class);
60  }
61  /**
62   * Inserts a new pretargeting configuration. (pretargetingConfig.insert)
63   *
64   * @param string $accountId The account id to insert the pretargeting config
65   * for.
66   * @param PretargetingConfigModel $postBody
67   * @param array $optParams Optional parameters.
68   * @return PretargetingConfigModel
69   */
70  public function insert($accountId, PretargetingConfigModel $postBody, $optParams = [])
71  {
72    $params = ['accountId' => $accountId, 'postBody' => $postBody];
73    $params = array_merge($params, $optParams);
74    return $this->call('insert', [$params], PretargetingConfigModel::class);
75  }
76  /**
77   * Retrieves a list of the authenticated user's pretargeting configurations.
78   * (pretargetingConfig.listPretargetingConfig)
79   *
80   * @param string $accountId The account id to get the pretargeting configs for.
81   * @param array $optParams Optional parameters.
82   * @return PretargetingConfigList
83   */
84  public function listPretargetingConfig($accountId, $optParams = [])
85  {
86    $params = ['accountId' => $accountId];
87    $params = array_merge($params, $optParams);
88    return $this->call('list', [$params], PretargetingConfigList::class);
89  }
90  /**
91   * Updates an existing pretargeting config. This method supports patch
92   * semantics. (pretargetingConfig.patch)
93   *
94   * @param string $accountId The account id to update the pretargeting config
95   * for.
96   * @param string $configId The specific id of the configuration to update.
97   * @param PretargetingConfigModel $postBody
98   * @param array $optParams Optional parameters.
99   * @return PretargetingConfigModel
100   */
101  public function patch($accountId, $configId, PretargetingConfigModel $postBody, $optParams = [])
102  {
103    $params = ['accountId' => $accountId, 'configId' => $configId, 'postBody' => $postBody];
104    $params = array_merge($params, $optParams);
105    return $this->call('patch', [$params], PretargetingConfigModel::class);
106  }
107  /**
108   * Updates an existing pretargeting config. (pretargetingConfig.update)
109   *
110   * @param string $accountId The account id to update the pretargeting config
111   * for.
112   * @param string $configId The specific id of the configuration to update.
113   * @param PretargetingConfigModel $postBody
114   * @param array $optParams Optional parameters.
115   * @return PretargetingConfigModel
116   */
117  public function update($accountId, $configId, PretargetingConfigModel $postBody, $optParams = [])
118  {
119    $params = ['accountId' => $accountId, 'configId' => $configId, 'postBody' => $postBody];
120    $params = array_merge($params, $optParams);
121    return $this->call('update', [$params], PretargetingConfigModel::class);
122  }
123}
124
125// Adding a class alias for backwards compatibility with the previous class name.
126class_alias(PretargetingConfig::class, 'Google_Service_AdExchangeBuyer_Resource_PretargetingConfig');
127