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\EventTag;
21use Google\Service\Dfareporting\EventTagsListResponse;
22
23/**
24 * The "eventTags" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $dfareportingService = new Google\Service\Dfareporting(...);
28 *   $eventTags = $dfareportingService->eventTags;
29 *  </code>
30 */
31class EventTags extends \Google\Service\Resource
32{
33  /**
34   * Deletes an existing event tag. (eventTags.delete)
35   *
36   * @param string $profileId User profile ID associated with this request.
37   * @param string $id Event tag 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 event tag by ID. (eventTags.get)
48   *
49   * @param string $profileId User profile ID associated with this request.
50   * @param string $id Event tag ID.
51   * @param array $optParams Optional parameters.
52   * @return EventTag
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], EventTag::class);
59  }
60  /**
61   * Inserts a new event tag. (eventTags.insert)
62   *
63   * @param string $profileId User profile ID associated with this request.
64   * @param EventTag $postBody
65   * @param array $optParams Optional parameters.
66   * @return EventTag
67   */
68  public function insert($profileId, EventTag $postBody, $optParams = [])
69  {
70    $params = ['profileId' => $profileId, 'postBody' => $postBody];
71    $params = array_merge($params, $optParams);
72    return $this->call('insert', [$params], EventTag::class);
73  }
74  /**
75   * Retrieves a list of event tags, possibly filtered. (eventTags.listEventTags)
76   *
77   * @param string $profileId User profile ID associated with this request.
78   * @param array $optParams Optional parameters.
79   *
80   * @opt_param string adId Select only event tags that belong to this ad.
81   * @opt_param string advertiserId Select only event tags that belong to this
82   * advertiser.
83   * @opt_param string campaignId Select only event tags that belong to this
84   * campaign.
85   * @opt_param bool definitionsOnly Examine only the specified campaign or
86   * advertiser's event tags for matching selector criteria. When set to false,
87   * the parent advertiser and parent campaign of the specified ad or campaign is
88   * examined as well. In addition, when set to false, the status field is
89   * examined as well, along with the enabledByDefault field. This parameter can
90   * not be set to true when adId is specified as ads do not define their own even
91   * tags.
92   * @opt_param bool enabled Select only enabled event tags. What is considered
93   * enabled or disabled depends on the definitionsOnly parameter. When
94   * definitionsOnly is set to true, only the specified advertiser or campaign's
95   * event tags' enabledByDefault field is examined. When definitionsOnly is set
96   * to false, the specified ad or specified campaign's parent advertiser's or
97   * parent campaign's event tags' enabledByDefault and status fields are examined
98   * as well.
99   * @opt_param string eventTagTypes Select only event tags with the specified
100   * event tag types. Event tag types can be used to specify whether to use a
101   * third-party pixel, a third-party JavaScript URL, or a third-party click-
102   * through URL for either impression or click tracking.
103   * @opt_param string ids Select only event tags with these IDs.
104   * @opt_param string searchString Allows searching for objects by name or ID.
105   * Wildcards (*) are allowed. For example, "eventtag*2015" will return objects
106   * with names like "eventtag June 2015", "eventtag April 2015", or simply
107   * "eventtag 2015". Most of the searches also add wildcards implicitly at the
108   * start and the end of the search string. For example, a search string of
109   * "eventtag" will match objects with name "my eventtag", "eventtag 2015", or
110   * simply "eventtag".
111   * @opt_param string sortField Field by which to sort the list.
112   * @opt_param string sortOrder Order of sorted results.
113   * @return EventTagsListResponse
114   */
115  public function listEventTags($profileId, $optParams = [])
116  {
117    $params = ['profileId' => $profileId];
118    $params = array_merge($params, $optParams);
119    return $this->call('list', [$params], EventTagsListResponse::class);
120  }
121  /**
122   * Updates an existing event tag. This method supports patch semantics.
123   * (eventTags.patch)
124   *
125   * @param string $profileId User profile ID associated with this request.
126   * @param string $id EventTag ID.
127   * @param EventTag $postBody
128   * @param array $optParams Optional parameters.
129   * @return EventTag
130   */
131  public function patch($profileId, $id, EventTag $postBody, $optParams = [])
132  {
133    $params = ['profileId' => $profileId, 'id' => $id, 'postBody' => $postBody];
134    $params = array_merge($params, $optParams);
135    return $this->call('patch', [$params], EventTag::class);
136  }
137  /**
138   * Updates an existing event tag. (eventTags.update)
139   *
140   * @param string $profileId User profile ID associated with this request.
141   * @param EventTag $postBody
142   * @param array $optParams Optional parameters.
143   * @return EventTag
144   */
145  public function update($profileId, EventTag $postBody, $optParams = [])
146  {
147    $params = ['profileId' => $profileId, 'postBody' => $postBody];
148    $params = array_merge($params, $optParams);
149    return $this->call('update', [$params], EventTag::class);
150  }
151}
152
153// Adding a class alias for backwards compatibility with the previous class name.
154class_alias(EventTags::class, 'Google_Service_Dfareporting_Resource_EventTags');
155