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