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