[e3d4e0a] | 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\Subaccount;
|
---|
| 21 | use Google\Service\Dfareporting\SubaccountsListResponse;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * The "subaccounts" collection of methods.
|
---|
| 25 | * Typical usage is:
|
---|
| 26 | * <code>
|
---|
| 27 | * $dfareportingService = new Google\Service\Dfareporting(...);
|
---|
| 28 | * $subaccounts = $dfareportingService->subaccounts;
|
---|
| 29 | * </code>
|
---|
| 30 | */
|
---|
| 31 | class Subaccounts extends \Google\Service\Resource
|
---|
| 32 | {
|
---|
| 33 | /**
|
---|
| 34 | * Gets one subaccount by ID. (subaccounts.get)
|
---|
| 35 | *
|
---|
| 36 | * @param string $profileId User profile ID associated with this request.
|
---|
| 37 | * @param string $id Subaccount ID.
|
---|
| 38 | * @param array $optParams Optional parameters.
|
---|
| 39 | * @return Subaccount
|
---|
| 40 | * @throws \Google\Service\Exception
|
---|
| 41 | */
|
---|
| 42 | public function get($profileId, $id, $optParams = [])
|
---|
| 43 | {
|
---|
| 44 | $params = ['profileId' => $profileId, 'id' => $id];
|
---|
| 45 | $params = array_merge($params, $optParams);
|
---|
| 46 | return $this->call('get', [$params], Subaccount::class);
|
---|
| 47 | }
|
---|
| 48 | /**
|
---|
| 49 | * Inserts a new subaccount. (subaccounts.insert)
|
---|
| 50 | *
|
---|
| 51 | * @param string $profileId User profile ID associated with this request.
|
---|
| 52 | * @param Subaccount $postBody
|
---|
| 53 | * @param array $optParams Optional parameters.
|
---|
| 54 | * @return Subaccount
|
---|
| 55 | * @throws \Google\Service\Exception
|
---|
| 56 | */
|
---|
| 57 | public function insert($profileId, Subaccount $postBody, $optParams = [])
|
---|
| 58 | {
|
---|
| 59 | $params = ['profileId' => $profileId, 'postBody' => $postBody];
|
---|
| 60 | $params = array_merge($params, $optParams);
|
---|
| 61 | return $this->call('insert', [$params], Subaccount::class);
|
---|
| 62 | }
|
---|
| 63 | /**
|
---|
| 64 | * Gets a list of subaccounts, possibly filtered. This method supports paging.
|
---|
| 65 | * (subaccounts.listSubaccounts)
|
---|
| 66 | *
|
---|
| 67 | * @param string $profileId User profile ID associated with this request.
|
---|
| 68 | * @param array $optParams Optional parameters.
|
---|
| 69 | *
|
---|
| 70 | * @opt_param string ids Select only subaccounts with these IDs.
|
---|
| 71 | * @opt_param int maxResults Maximum number of results to return.
|
---|
| 72 | * @opt_param string pageToken Value of the nextPageToken from the previous
|
---|
| 73 | * result page.
|
---|
| 74 | * @opt_param string searchString Allows searching for objects by name or ID.
|
---|
| 75 | * Wildcards (*) are allowed. For example, "subaccount*2015" will return objects
|
---|
| 76 | * with names like "subaccount June 2015", "subaccount April 2015", or simply
|
---|
| 77 | * "subaccount 2015". Most of the searches also add wildcards implicitly at the
|
---|
| 78 | * start and the end of the search string. For example, a search string of
|
---|
| 79 | * "subaccount" will match objects with name "my subaccount", "subaccount 2015",
|
---|
| 80 | * or simply "subaccount" .
|
---|
| 81 | * @opt_param string sortField Field by which to sort the list.
|
---|
| 82 | * @opt_param string sortOrder Order of sorted results.
|
---|
| 83 | * @return SubaccountsListResponse
|
---|
| 84 | * @throws \Google\Service\Exception
|
---|
| 85 | */
|
---|
| 86 | public function listSubaccounts($profileId, $optParams = [])
|
---|
| 87 | {
|
---|
| 88 | $params = ['profileId' => $profileId];
|
---|
| 89 | $params = array_merge($params, $optParams);
|
---|
| 90 | return $this->call('list', [$params], SubaccountsListResponse::class);
|
---|
| 91 | }
|
---|
| 92 | /**
|
---|
| 93 | * Updates an existing subaccount. This method supports patch semantics.
|
---|
| 94 | * (subaccounts.patch)
|
---|
| 95 | *
|
---|
| 96 | * @param string $profileId User profile ID associated with this request.
|
---|
| 97 | * @param string $id Required. Subaccount ID.
|
---|
| 98 | * @param Subaccount $postBody
|
---|
| 99 | * @param array $optParams Optional parameters.
|
---|
| 100 | * @return Subaccount
|
---|
| 101 | * @throws \Google\Service\Exception
|
---|
| 102 | */
|
---|
| 103 | public function patch($profileId, $id, Subaccount $postBody, $optParams = [])
|
---|
| 104 | {
|
---|
| 105 | $params = ['profileId' => $profileId, 'id' => $id, 'postBody' => $postBody];
|
---|
| 106 | $params = array_merge($params, $optParams);
|
---|
| 107 | return $this->call('patch', [$params], Subaccount::class);
|
---|
| 108 | }
|
---|
| 109 | /**
|
---|
| 110 | * Updates an existing subaccount. (subaccounts.update)
|
---|
| 111 | *
|
---|
| 112 | * @param string $profileId User profile ID associated with this request.
|
---|
| 113 | * @param Subaccount $postBody
|
---|
| 114 | * @param array $optParams Optional parameters.
|
---|
| 115 | * @return Subaccount
|
---|
| 116 | * @throws \Google\Service\Exception
|
---|
| 117 | */
|
---|
| 118 | public function update($profileId, Subaccount $postBody, $optParams = [])
|
---|
| 119 | {
|
---|
| 120 | $params = ['profileId' => $profileId, 'postBody' => $postBody];
|
---|
| 121 | $params = array_merge($params, $optParams);
|
---|
| 122 | return $this->call('update', [$params], Subaccount::class);
|
---|
| 123 | }
|
---|
| 124 | }
|
---|
| 125 |
|
---|
| 126 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 127 | class_alias(Subaccounts::class, 'Google_Service_Dfareporting_Resource_Subaccounts');
|
---|