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\Dfareporting\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Dfareporting\BillingAssignment;
|
---|
21 | use Google\Service\Dfareporting\BillingAssignmentsListResponse;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "billingAssignments" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $dfareportingService = new Google\Service\Dfareporting(...);
|
---|
28 | * $billingAssignments = $dfareportingService->billingAssignments;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class BillingAssignments extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Inserts a new billing assignment and returns the new assignment. Only one of
|
---|
35 | * advertiser_id or campaign_id is support per request. If the new assignment
|
---|
36 | * has no effect (assigning a campaign to the parent advertiser billing profile
|
---|
37 | * or assigning an advertiser to the account billing profile), no assignment
|
---|
38 | * will be returned. (billingAssignments.insert)
|
---|
39 | *
|
---|
40 | * @param string $profileId User profile ID associated with this request.
|
---|
41 | * @param string $billingProfileId Billing profile ID of this billing
|
---|
42 | * assignment.
|
---|
43 | * @param BillingAssignment $postBody
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | * @return BillingAssignment
|
---|
46 | * @throws \Google\Service\Exception
|
---|
47 | */
|
---|
48 | public function insert($profileId, $billingProfileId, BillingAssignment $postBody, $optParams = [])
|
---|
49 | {
|
---|
50 | $params = ['profileId' => $profileId, 'billingProfileId' => $billingProfileId, 'postBody' => $postBody];
|
---|
51 | $params = array_merge($params, $optParams);
|
---|
52 | return $this->call('insert', [$params], BillingAssignment::class);
|
---|
53 | }
|
---|
54 | /**
|
---|
55 | * Retrieves a list of billing assignments.
|
---|
56 | * (billingAssignments.listBillingAssignments)
|
---|
57 | *
|
---|
58 | * @param string $profileId User profile ID associated with this request.
|
---|
59 | * @param string $billingProfileId Billing profile ID of this billing
|
---|
60 | * assignment.
|
---|
61 | * @param array $optParams Optional parameters.
|
---|
62 | * @return BillingAssignmentsListResponse
|
---|
63 | * @throws \Google\Service\Exception
|
---|
64 | */
|
---|
65 | public function listBillingAssignments($profileId, $billingProfileId, $optParams = [])
|
---|
66 | {
|
---|
67 | $params = ['profileId' => $profileId, 'billingProfileId' => $billingProfileId];
|
---|
68 | $params = array_merge($params, $optParams);
|
---|
69 | return $this->call('list', [$params], BillingAssignmentsListResponse::class);
|
---|
70 | }
|
---|
71 | }
|
---|
72 |
|
---|
73 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
74 | class_alias(BillingAssignments::class, 'Google_Service_Dfareporting_Resource_BillingAssignments');
|
---|