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\RealTimeBidding\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\RealTimeBidding\Creative;
|
---|
21 | use Google\Service\RealTimeBidding\ListCreativesResponse;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "creatives" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $realtimebiddingService = new Google\Service\RealTimeBidding(...);
|
---|
28 | * $creatives = $realtimebiddingService->buyers_creatives;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class BuyersCreatives extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Creates a creative. (creatives.create)
|
---|
35 | *
|
---|
36 | * @param string $parent Required. The name of the parent buyer that the new
|
---|
37 | * creative belongs to that must follow the pattern `buyers/{buyerAccountId}`,
|
---|
38 | * where `{buyerAccountId}` represents the account ID of the buyer who owns a
|
---|
39 | * creative. For a bidder accessing creatives on behalf of a child seat buyer,
|
---|
40 | * `{buyerAccountId}` should represent the account ID of the child seat buyer.
|
---|
41 | * @param Creative $postBody
|
---|
42 | * @param array $optParams Optional parameters.
|
---|
43 | * @return Creative
|
---|
44 | * @throws \Google\Service\Exception
|
---|
45 | */
|
---|
46 | public function create($parent, Creative $postBody, $optParams = [])
|
---|
47 | {
|
---|
48 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
49 | $params = array_merge($params, $optParams);
|
---|
50 | return $this->call('create', [$params], Creative::class);
|
---|
51 | }
|
---|
52 | /**
|
---|
53 | * Gets a creative. (creatives.get)
|
---|
54 | *
|
---|
55 | * @param string $name Required. Name of the creative to retrieve. See
|
---|
56 | * creative.name.
|
---|
57 | * @param array $optParams Optional parameters.
|
---|
58 | *
|
---|
59 | * @opt_param string view Controls the amount of information included in the
|
---|
60 | * response. By default only creativeServingDecision is included. To retrieve
|
---|
61 | * the entire creative resource (including the declared fields and the creative
|
---|
62 | * content) specify the view as "FULL".
|
---|
63 | * @return Creative
|
---|
64 | * @throws \Google\Service\Exception
|
---|
65 | */
|
---|
66 | public function get($name, $optParams = [])
|
---|
67 | {
|
---|
68 | $params = ['name' => $name];
|
---|
69 | $params = array_merge($params, $optParams);
|
---|
70 | return $this->call('get', [$params], Creative::class);
|
---|
71 | }
|
---|
72 | /**
|
---|
73 | * Lists creatives as they are at the time of the initial request. This call may
|
---|
74 | * take multiple hours to complete. For large, paginated requests, this method
|
---|
75 | * returns a snapshot of creatives at the time of request for the first page.
|
---|
76 | * `lastStatusUpdate` and `creativeServingDecision` may be outdated for
|
---|
77 | * creatives on sequential pages. We recommend [Google Cloud
|
---|
78 | * Pub/Sub](//cloud.google.com/pubsub/docs/overview) to view the latest status.
|
---|
79 | * (creatives.listBuyersCreatives)
|
---|
80 | *
|
---|
81 | * @param string $parent Required. Name of the parent buyer that owns the
|
---|
82 | * creatives. The pattern for this resource is either `buyers/{buyerAccountId}`
|
---|
83 | * or `bidders/{bidderAccountId}`. For `buyers/{buyerAccountId}`, the
|
---|
84 | * `buyerAccountId` can be one of the following: 1. The ID of the buyer that is
|
---|
85 | * accessing their own creatives. 2. The ID of the child seat buyer under a
|
---|
86 | * bidder account. So for listing creatives pertaining to the child seat buyer
|
---|
87 | * (`456`) under bidder account (`123`), you would use the pattern:
|
---|
88 | * `buyers/456`. 3. The ID of the bidder itself. So for listing creatives
|
---|
89 | * pertaining to bidder (`123`), you would use `buyers/123`. If you want to
|
---|
90 | * access all creatives pertaining to both the bidder and all of its child seat
|
---|
91 | * accounts, you would use `bidders/{bidderAccountId}`, for example, for all
|
---|
92 | * creatives pertaining to bidder (`123`), use `bidders/123`.
|
---|
93 | * @param array $optParams Optional parameters.
|
---|
94 | *
|
---|
95 | * @opt_param string filter Query string to filter creatives. If no filter is
|
---|
96 | * specified, all active creatives will be returned. Example: 'accountId=12345
|
---|
97 | * AND (dealsStatus:DISAPPROVED AND disapprovalReason:UNACCEPTABLE_CONTENT) OR
|
---|
98 | * declaredAttributes:IS_COOKIE_TARGETED'
|
---|
99 | * @opt_param int pageSize Requested page size. The server may return fewer
|
---|
100 | * creatives than requested (due to timeout constraint) even if more are
|
---|
101 | * available through another call. If unspecified, server will pick an
|
---|
102 | * appropriate default. Acceptable values are 1 to 1000, inclusive.
|
---|
103 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
104 | * should return. Typically, this is the value of
|
---|
105 | * ListCreativesResponse.nextPageToken returned from the previous call to the
|
---|
106 | * 'ListCreatives' method. Page tokens for continued pages are valid for up to
|
---|
107 | * five hours, counting from the call to 'ListCreatives' for the first page.
|
---|
108 | * @opt_param string view Controls the amount of information included in the
|
---|
109 | * response. By default only creativeServingDecision is included. To retrieve
|
---|
110 | * the entire creative resource (including the declared fields and the creative
|
---|
111 | * content) specify the view as "FULL".
|
---|
112 | * @return ListCreativesResponse
|
---|
113 | * @throws \Google\Service\Exception
|
---|
114 | */
|
---|
115 | public function listBuyersCreatives($parent, $optParams = [])
|
---|
116 | {
|
---|
117 | $params = ['parent' => $parent];
|
---|
118 | $params = array_merge($params, $optParams);
|
---|
119 | return $this->call('list', [$params], ListCreativesResponse::class);
|
---|
120 | }
|
---|
121 | /**
|
---|
122 | * Updates a creative. (creatives.patch)
|
---|
123 | *
|
---|
124 | * @param string $name Output only. Name of the creative. Follows the pattern
|
---|
125 | * `buyers/{buyer}/creatives/{creative}`, where `{buyer}` represents the account
|
---|
126 | * ID of the buyer who owns the creative, and `{creative}` is the buyer-specific
|
---|
127 | * creative ID that references this creative in the bid response.
|
---|
128 | * @param Creative $postBody
|
---|
129 | * @param array $optParams Optional parameters.
|
---|
130 | *
|
---|
131 | * @opt_param string updateMask Field mask to use for partial in-place updates.
|
---|
132 | * @return Creative
|
---|
133 | * @throws \Google\Service\Exception
|
---|
134 | */
|
---|
135 | public function patch($name, Creative $postBody, $optParams = [])
|
---|
136 | {
|
---|
137 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
138 | $params = array_merge($params, $optParams);
|
---|
139 | return $this->call('patch', [$params], Creative::class);
|
---|
140 | }
|
---|
141 | }
|
---|
142 |
|
---|
143 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
144 | class_alias(BuyersCreatives::class, 'Google_Service_RealTimeBidding_Resource_BuyersCreatives');
|
---|