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\AddDealAssociationRequest;
|
---|
21 | use Google\Service\AdExchangeBuyerII\Adexchangebuyer2Empty;
|
---|
22 | use Google\Service\AdExchangeBuyerII\ListDealAssociationsResponse;
|
---|
23 | use Google\Service\AdExchangeBuyerII\RemoveDealAssociationRequest;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "dealAssociations" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $adexchangebuyer2Service = new Google\Service\AdExchangeBuyerII(...);
|
---|
30 | * $dealAssociations = $adexchangebuyer2Service->accounts_creatives_dealAssociations;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class AccountsCreativesDealAssociations extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Associate an existing deal with a creative. (dealAssociations.add)
|
---|
37 | *
|
---|
38 | * @param string $accountId The account the creative belongs to.
|
---|
39 | * @param string $creativeId The ID of the creative associated with the deal.
|
---|
40 | * @param AddDealAssociationRequest $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | * @return Adexchangebuyer2Empty
|
---|
43 | * @throws \Google\Service\Exception
|
---|
44 | */
|
---|
45 | public function add($accountId, $creativeId, AddDealAssociationRequest $postBody, $optParams = [])
|
---|
46 | {
|
---|
47 | $params = ['accountId' => $accountId, 'creativeId' => $creativeId, 'postBody' => $postBody];
|
---|
48 | $params = array_merge($params, $optParams);
|
---|
49 | return $this->call('add', [$params], Adexchangebuyer2Empty::class);
|
---|
50 | }
|
---|
51 | /**
|
---|
52 | * List all creative-deal associations.
|
---|
53 | * (dealAssociations.listAccountsCreativesDealAssociations)
|
---|
54 | *
|
---|
55 | * @param string $accountId The account to list the associations from. Specify
|
---|
56 | * "-" to list all creatives the current user has access to.
|
---|
57 | * @param string $creativeId The creative ID to list the associations from.
|
---|
58 | * Specify "-" to list all creatives under the above account.
|
---|
59 | * @param array $optParams Optional parameters.
|
---|
60 | *
|
---|
61 | * @opt_param int pageSize Requested page size. Server may return fewer
|
---|
62 | * associations than requested. If unspecified, server will pick an appropriate
|
---|
63 | * default.
|
---|
64 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
65 | * should return. Typically, this is the value of
|
---|
66 | * ListDealAssociationsResponse.next_page_token returned from the previous call
|
---|
67 | * to 'ListDealAssociations' method.
|
---|
68 | * @opt_param string query An optional query string to filter deal associations.
|
---|
69 | * If no filter is specified, all associations will be returned. Supported
|
---|
70 | * queries are: - accountId=*account_id_string* -
|
---|
71 | * creativeId=*creative_id_string* - dealsId=*deals_id_string* -
|
---|
72 | * dealsStatus:{approved, conditionally_approved, disapproved, not_checked} -
|
---|
73 | * openAuctionStatus:{approved, conditionally_approved, disapproved,
|
---|
74 | * not_checked} Example: 'dealsId=12345 AND dealsStatus:disapproved'
|
---|
75 | * @return ListDealAssociationsResponse
|
---|
76 | * @throws \Google\Service\Exception
|
---|
77 | */
|
---|
78 | public function listAccountsCreativesDealAssociations($accountId, $creativeId, $optParams = [])
|
---|
79 | {
|
---|
80 | $params = ['accountId' => $accountId, 'creativeId' => $creativeId];
|
---|
81 | $params = array_merge($params, $optParams);
|
---|
82 | return $this->call('list', [$params], ListDealAssociationsResponse::class);
|
---|
83 | }
|
---|
84 | /**
|
---|
85 | * Remove the association between a deal and a creative.
|
---|
86 | * (dealAssociations.remove)
|
---|
87 | *
|
---|
88 | * @param string $accountId The account the creative belongs to.
|
---|
89 | * @param string $creativeId The ID of the creative associated with the deal.
|
---|
90 | * @param RemoveDealAssociationRequest $postBody
|
---|
91 | * @param array $optParams Optional parameters.
|
---|
92 | * @return Adexchangebuyer2Empty
|
---|
93 | * @throws \Google\Service\Exception
|
---|
94 | */
|
---|
95 | public function remove($accountId, $creativeId, RemoveDealAssociationRequest $postBody, $optParams = [])
|
---|
96 | {
|
---|
97 | $params = ['accountId' => $accountId, 'creativeId' => $creativeId, 'postBody' => $postBody];
|
---|
98 | $params = array_merge($params, $optParams);
|
---|
99 | return $this->call('remove', [$params], Adexchangebuyer2Empty::class);
|
---|
100 | }
|
---|
101 | }
|
---|
102 |
|
---|
103 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
104 | class_alias(AccountsCreativesDealAssociations::class, 'Google_Service_AdExchangeBuyerII_Resource_AccountsCreativesDealAssociations');
|
---|