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\GoogleAnalyticsAdmin\Resource;
19
20use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1alphaConversionEvent;
21use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1alphaListConversionEventsResponse;
22use Google\Service\GoogleAnalyticsAdmin\GoogleProtobufEmpty;
23
24/**
25 * The "conversionEvents" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $analyticsadminService = new Google\Service\GoogleAnalyticsAdmin(...);
29 *   $conversionEvents = $analyticsadminService->conversionEvents;
30 *  </code>
31 */
32class PropertiesConversionEvents extends \Google\Service\Resource
33{
34  /**
35   * Creates a conversion event with the specified attributes.
36   * (conversionEvents.create)
37   *
38   * @param string $parent Required. The resource name of the parent property
39   * where this conversion event will be created. Format: properties/123
40   * @param GoogleAnalyticsAdminV1alphaConversionEvent $postBody
41   * @param array $optParams Optional parameters.
42   * @return GoogleAnalyticsAdminV1alphaConversionEvent
43   */
44  public function create($parent, GoogleAnalyticsAdminV1alphaConversionEvent $postBody, $optParams = [])
45  {
46    $params = ['parent' => $parent, 'postBody' => $postBody];
47    $params = array_merge($params, $optParams);
48    return $this->call('create', [$params], GoogleAnalyticsAdminV1alphaConversionEvent::class);
49  }
50  /**
51   * Deletes a conversion event in a property. (conversionEvents.delete)
52   *
53   * @param string $name Required. The resource name of the conversion event to
54   * delete. Format: properties/{property}/conversionEvents/{conversion_event}
55   * Example: "properties/123/conversionEvents/456"
56   * @param array $optParams Optional parameters.
57   * @return GoogleProtobufEmpty
58   */
59  public function delete($name, $optParams = [])
60  {
61    $params = ['name' => $name];
62    $params = array_merge($params, $optParams);
63    return $this->call('delete', [$params], GoogleProtobufEmpty::class);
64  }
65  /**
66   * Retrieve a single conversion event. (conversionEvents.get)
67   *
68   * @param string $name Required. The resource name of the conversion event to
69   * retrieve. Format: properties/{property}/conversionEvents/{conversion_event}
70   * Example: "properties/123/conversionEvents/456"
71   * @param array $optParams Optional parameters.
72   * @return GoogleAnalyticsAdminV1alphaConversionEvent
73   */
74  public function get($name, $optParams = [])
75  {
76    $params = ['name' => $name];
77    $params = array_merge($params, $optParams);
78    return $this->call('get', [$params], GoogleAnalyticsAdminV1alphaConversionEvent::class);
79  }
80  /**
81   * Returns a list of conversion events in the specified parent property. Returns
82   * an empty list if no conversion events are found.
83   * (conversionEvents.listPropertiesConversionEvents)
84   *
85   * @param string $parent Required. The resource name of the parent property.
86   * Example: 'properties/123'
87   * @param array $optParams Optional parameters.
88   *
89   * @opt_param int pageSize The maximum number of resources to return. If
90   * unspecified, at most 50 resources will be returned. The maximum value is 200;
91   * (higher values will be coerced to the maximum)
92   * @opt_param string pageToken A page token, received from a previous
93   * `ListConversionEvents` call. Provide this to retrieve the subsequent page.
94   * When paginating, all other parameters provided to `ListConversionEvents` must
95   * match the call that provided the page token.
96   * @return GoogleAnalyticsAdminV1alphaListConversionEventsResponse
97   */
98  public function listPropertiesConversionEvents($parent, $optParams = [])
99  {
100    $params = ['parent' => $parent];
101    $params = array_merge($params, $optParams);
102    return $this->call('list', [$params], GoogleAnalyticsAdminV1alphaListConversionEventsResponse::class);
103  }
104}
105
106// Adding a class alias for backwards compatibility with the previous class name.
107class_alias(PropertiesConversionEvents::class, 'Google_Service_GoogleAnalyticsAdmin_Resource_PropertiesConversionEvents');
108