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 |
|
---|
18 | namespace Google\Service\AdExchangeBuyerII\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\AdExchangeBuyerII\Adexchangebuyer2Empty;
|
---|
21 | use Google\Service\AdExchangeBuyerII\Creative;
|
---|
22 | use Google\Service\AdExchangeBuyerII\ListCreativesResponse;
|
---|
23 | use Google\Service\AdExchangeBuyerII\StopWatchingCreativeRequest;
|
---|
24 | use Google\Service\AdExchangeBuyerII\WatchCreativeRequest;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "creatives" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $adexchangebuyer2Service = new Google\Service\AdExchangeBuyerII(...);
|
---|
31 | * $creatives = $adexchangebuyer2Service->accounts_creatives;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class AccountsCreatives extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Creates a creative. (creatives.create)
|
---|
38 | *
|
---|
39 | * @param string $accountId The account that this creative belongs to. Can be
|
---|
40 | * used to filter the response of the creatives.list method.
|
---|
41 | * @param Creative $postBody
|
---|
42 | * @param array $optParams Optional parameters.
|
---|
43 | *
|
---|
44 | * @opt_param string duplicateIdMode Indicates if multiple creatives can share
|
---|
45 | * an ID or not. Default is NO_DUPLICATES (one ID per creative).
|
---|
46 | * @return Creative
|
---|
47 | * @throws \Google\Service\Exception
|
---|
48 | */
|
---|
49 | public function create($accountId, Creative $postBody, $optParams = [])
|
---|
50 | {
|
---|
51 | $params = ['accountId' => $accountId, 'postBody' => $postBody];
|
---|
52 | $params = array_merge($params, $optParams);
|
---|
53 | return $this->call('create', [$params], Creative::class);
|
---|
54 | }
|
---|
55 | /**
|
---|
56 | * Gets a creative. (creatives.get)
|
---|
57 | *
|
---|
58 | * @param string $accountId The account the creative belongs to.
|
---|
59 | * @param string $creativeId The ID of the creative to retrieve.
|
---|
60 | * @param array $optParams Optional parameters.
|
---|
61 | * @return Creative
|
---|
62 | * @throws \Google\Service\Exception
|
---|
63 | */
|
---|
64 | public function get($accountId, $creativeId, $optParams = [])
|
---|
65 | {
|
---|
66 | $params = ['accountId' => $accountId, 'creativeId' => $creativeId];
|
---|
67 | $params = array_merge($params, $optParams);
|
---|
68 | return $this->call('get', [$params], Creative::class);
|
---|
69 | }
|
---|
70 | /**
|
---|
71 | * Lists creatives. (creatives.listAccountsCreatives)
|
---|
72 | *
|
---|
73 | * @param string $accountId The account to list the creatives from. Specify "-"
|
---|
74 | * to list all creatives the current user has access to.
|
---|
75 | * @param array $optParams Optional parameters.
|
---|
76 | *
|
---|
77 | * @opt_param int pageSize Requested page size. The server may return fewer
|
---|
78 | * creatives than requested (due to timeout constraint) even if more are
|
---|
79 | * available through another call. If unspecified, server will pick an
|
---|
80 | * appropriate default. Acceptable values are 1 to 1000, inclusive.
|
---|
81 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
82 | * should return. Typically, this is the value of
|
---|
83 | * ListCreativesResponse.next_page_token returned from the previous call to
|
---|
84 | * 'ListCreatives' method.
|
---|
85 | * @opt_param string query An optional query string to filter creatives. If no
|
---|
86 | * filter is specified, all active creatives will be returned. Supported queries
|
---|
87 | * are: - accountId=*account_id_string* - creativeId=*creative_id_string* -
|
---|
88 | * dealsStatus: {approved, conditionally_approved, disapproved, not_checked} -
|
---|
89 | * openAuctionStatus: {approved, conditionally_approved, disapproved,
|
---|
90 | * not_checked} - attribute: {a numeric attribute from the list of attributes} -
|
---|
91 | * disapprovalReason: {a reason from DisapprovalReason} Example:
|
---|
92 | * 'accountId=12345 AND (dealsStatus:disapproved AND
|
---|
93 | * disapprovalReason:unacceptable_content) OR attribute:47'
|
---|
94 | * @return ListCreativesResponse
|
---|
95 | * @throws \Google\Service\Exception
|
---|
96 | */
|
---|
97 | public function listAccountsCreatives($accountId, $optParams = [])
|
---|
98 | {
|
---|
99 | $params = ['accountId' => $accountId];
|
---|
100 | $params = array_merge($params, $optParams);
|
---|
101 | return $this->call('list', [$params], ListCreativesResponse::class);
|
---|
102 | }
|
---|
103 | /**
|
---|
104 | * Stops watching a creative. Will stop push notifications being sent to the
|
---|
105 | * topics when the creative changes status. (creatives.stopWatching)
|
---|
106 | *
|
---|
107 | * @param string $accountId The account of the creative to stop notifications
|
---|
108 | * for.
|
---|
109 | * @param string $creativeId The creative ID of the creative to stop
|
---|
110 | * notifications for. Specify "-" to specify stopping account level
|
---|
111 | * notifications.
|
---|
112 | * @param StopWatchingCreativeRequest $postBody
|
---|
113 | * @param array $optParams Optional parameters.
|
---|
114 | * @return Adexchangebuyer2Empty
|
---|
115 | * @throws \Google\Service\Exception
|
---|
116 | */
|
---|
117 | public function stopWatching($accountId, $creativeId, StopWatchingCreativeRequest $postBody, $optParams = [])
|
---|
118 | {
|
---|
119 | $params = ['accountId' => $accountId, 'creativeId' => $creativeId, 'postBody' => $postBody];
|
---|
120 | $params = array_merge($params, $optParams);
|
---|
121 | return $this->call('stopWatching', [$params], Adexchangebuyer2Empty::class);
|
---|
122 | }
|
---|
123 | /**
|
---|
124 | * Updates a creative. (creatives.update)
|
---|
125 | *
|
---|
126 | * @param string $accountId The account that this creative belongs to. Can be
|
---|
127 | * used to filter the response of the creatives.list method.
|
---|
128 | * @param string $creativeId The buyer-defined creative ID of this creative. Can
|
---|
129 | * be used to filter the response of the creatives.list method.
|
---|
130 | * @param Creative $postBody
|
---|
131 | * @param array $optParams Optional parameters.
|
---|
132 | * @return Creative
|
---|
133 | * @throws \Google\Service\Exception
|
---|
134 | */
|
---|
135 | public function update($accountId, $creativeId, Creative $postBody, $optParams = [])
|
---|
136 | {
|
---|
137 | $params = ['accountId' => $accountId, 'creativeId' => $creativeId, 'postBody' => $postBody];
|
---|
138 | $params = array_merge($params, $optParams);
|
---|
139 | return $this->call('update', [$params], Creative::class);
|
---|
140 | }
|
---|
141 | /**
|
---|
142 | * Watches a creative. Will result in push notifications being sent to the topic
|
---|
143 | * when the creative changes status. (creatives.watch)
|
---|
144 | *
|
---|
145 | * @param string $accountId The account of the creative to watch.
|
---|
146 | * @param string $creativeId The creative ID to watch for status changes.
|
---|
147 | * Specify "-" to watch all creatives under the above account. If both creative-
|
---|
148 | * level and account-level notifications are sent, only a single notification
|
---|
149 | * will be sent to the creative-level notification topic.
|
---|
150 | * @param WatchCreativeRequest $postBody
|
---|
151 | * @param array $optParams Optional parameters.
|
---|
152 | * @return Adexchangebuyer2Empty
|
---|
153 | * @throws \Google\Service\Exception
|
---|
154 | */
|
---|
155 | public function watch($accountId, $creativeId, WatchCreativeRequest $postBody, $optParams = [])
|
---|
156 | {
|
---|
157 | $params = ['accountId' => $accountId, 'creativeId' => $creativeId, 'postBody' => $postBody];
|
---|
158 | $params = array_merge($params, $optParams);
|
---|
159 | return $this->call('watch', [$params], Adexchangebuyer2Empty::class);
|
---|
160 | }
|
---|
161 | }
|
---|
162 |
|
---|
163 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
164 | class_alias(AccountsCreatives::class, 'Google_Service_AdExchangeBuyerII_Resource_AccountsCreatives');
|
---|