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\Doubleclicksearch\Resource;
19
20use Google\Service\Doubleclicksearch\ConversionList;
21use Google\Service\Doubleclicksearch\UpdateAvailabilityRequest;
22use Google\Service\Doubleclicksearch\UpdateAvailabilityResponse;
23
24/**
25 * The "conversion" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $doubleclicksearchService = new Google\Service\Doubleclicksearch(...);
29 *   $conversion = $doubleclicksearchService->conversion;
30 *  </code>
31 */
32class Conversion extends \Google\Service\Resource
33{
34  /**
35   * Retrieves a list of conversions from a DoubleClick Search engine account.
36   * (conversion.get)
37   *
38   * @param string $agencyId Numeric ID of the agency.
39   * @param string $advertiserId Numeric ID of the advertiser.
40   * @param string $engineAccountId Numeric ID of the engine account.
41   * @param int $endDate Last date (inclusive) on which to retrieve conversions.
42   * Format is yyyymmdd.
43   * @param int $rowCount The number of conversions to return per call.
44   * @param int $startDate First date (inclusive) on which to retrieve
45   * conversions. Format is yyyymmdd.
46   * @param string $startRow The 0-based starting index for retrieving conversions
47   * results.
48   * @param array $optParams Optional parameters.
49   *
50   * @opt_param string adGroupId Numeric ID of the ad group.
51   * @opt_param string adId Numeric ID of the ad.
52   * @opt_param string campaignId Numeric ID of the campaign.
53   * @opt_param string criterionId Numeric ID of the criterion.
54   * @return ConversionList
55   */
56  public function get($agencyId, $advertiserId, $engineAccountId, $endDate, $rowCount, $startDate, $startRow, $optParams = [])
57  {
58    $params = ['agencyId' => $agencyId, 'advertiserId' => $advertiserId, 'engineAccountId' => $engineAccountId, 'endDate' => $endDate, 'rowCount' => $rowCount, 'startDate' => $startDate, 'startRow' => $startRow];
59    $params = array_merge($params, $optParams);
60    return $this->call('get', [$params], ConversionList::class);
61  }
62  /**
63   * Inserts a batch of new conversions into DoubleClick Search.
64   * (conversion.insert)
65   *
66   * @param ConversionList $postBody
67   * @param array $optParams Optional parameters.
68   * @return ConversionList
69   */
70  public function insert(ConversionList $postBody, $optParams = [])
71  {
72    $params = ['postBody' => $postBody];
73    $params = array_merge($params, $optParams);
74    return $this->call('insert', [$params], ConversionList::class);
75  }
76  /**
77   * Updates a batch of conversions in DoubleClick Search. (conversion.update)
78   *
79   * @param ConversionList $postBody
80   * @param array $optParams Optional parameters.
81   * @return ConversionList
82   */
83  public function update(ConversionList $postBody, $optParams = [])
84  {
85    $params = ['postBody' => $postBody];
86    $params = array_merge($params, $optParams);
87    return $this->call('update', [$params], ConversionList::class);
88  }
89  /**
90   * Updates the availabilities of a batch of floodlight activities in DoubleClick
91   * Search. (conversion.updateAvailability)
92   *
93   * @param UpdateAvailabilityRequest $postBody
94   * @param array $optParams Optional parameters.
95   * @return UpdateAvailabilityResponse
96   */
97  public function updateAvailability(UpdateAvailabilityRequest $postBody, $optParams = [])
98  {
99    $params = ['postBody' => $postBody];
100    $params = array_merge($params, $optParams);
101    return $this->call('updateAvailability', [$params], UpdateAvailabilityResponse::class);
102  }
103}
104
105// Adding a class alias for backwards compatibility with the previous class name.
106class_alias(Conversion::class, 'Google_Service_Doubleclicksearch_Resource_Conversion');
107