[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\Css\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Css\Account;
|
---|
| 21 | use Google\Service\Css\ListChildAccountsResponse;
|
---|
| 22 | use Google\Service\Css\UpdateAccountLabelsRequest;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "accounts" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $cssService = new Google\Service\Css(...);
|
---|
| 29 | * $accounts = $cssService->accounts;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class Accounts extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Retrieves a single CSS/MC account by ID. (accounts.get)
|
---|
| 36 | *
|
---|
| 37 | * @param string $name Required. The name of the managed CSS/MC account. Format:
|
---|
| 38 | * accounts/{account}
|
---|
| 39 | * @param array $optParams Optional parameters.
|
---|
| 40 | *
|
---|
| 41 | * @opt_param string parent Optional. Only required when retrieving MC account
|
---|
| 42 | * information. The CSS domain that is the parent resource of the MC account.
|
---|
| 43 | * Format: accounts/{account}
|
---|
| 44 | * @return Account
|
---|
| 45 | * @throws \Google\Service\Exception
|
---|
| 46 | */
|
---|
| 47 | public function get($name, $optParams = [])
|
---|
| 48 | {
|
---|
| 49 | $params = ['name' => $name];
|
---|
| 50 | $params = array_merge($params, $optParams);
|
---|
| 51 | return $this->call('get', [$params], Account::class);
|
---|
| 52 | }
|
---|
| 53 | /**
|
---|
| 54 | * Lists all the accounts under the specified CSS account ID, and optionally
|
---|
| 55 | * filters by label ID and account name. (accounts.listChildAccounts)
|
---|
| 56 | *
|
---|
| 57 | * @param string $parent Required. The parent account. Must be a CSS group or
|
---|
| 58 | * domain. Format: accounts/{account}
|
---|
| 59 | * @param array $optParams Optional parameters.
|
---|
| 60 | *
|
---|
| 61 | * @opt_param string fullName If set, only the MC accounts with the given name
|
---|
| 62 | * (case sensitive) will be returned.
|
---|
| 63 | * @opt_param string labelId If set, only the MC accounts with the given label
|
---|
| 64 | * ID will be returned.
|
---|
| 65 | * @opt_param int pageSize Optional. The maximum number of accounts to return.
|
---|
| 66 | * The service may return fewer than this value. If unspecified, at most 50
|
---|
| 67 | * accounts will be returned. The maximum value is 1000; values above 1000 will
|
---|
| 68 | * be coerced to 1000.
|
---|
| 69 | * @opt_param string pageToken Optional. A page token, received from a previous
|
---|
| 70 | * `ListChildAccounts` call. Provide this to retrieve the subsequent page. When
|
---|
| 71 | * paginating, all other parameters provided to `ListChildAccounts` must match
|
---|
| 72 | * the call that provided the page token.
|
---|
| 73 | * @return ListChildAccountsResponse
|
---|
| 74 | * @throws \Google\Service\Exception
|
---|
| 75 | */
|
---|
| 76 | public function listChildAccounts($parent, $optParams = [])
|
---|
| 77 | {
|
---|
| 78 | $params = ['parent' => $parent];
|
---|
| 79 | $params = array_merge($params, $optParams);
|
---|
| 80 | return $this->call('listChildAccounts', [$params], ListChildAccountsResponse::class);
|
---|
| 81 | }
|
---|
| 82 | /**
|
---|
| 83 | * Updates labels assigned to CSS/MC accounts by a CSS domain.
|
---|
| 84 | * (accounts.updateLabels)
|
---|
| 85 | *
|
---|
| 86 | * @param string $name Required. The label resource name. Format:
|
---|
| 87 | * accounts/{account}
|
---|
| 88 | * @param UpdateAccountLabelsRequest $postBody
|
---|
| 89 | * @param array $optParams Optional parameters.
|
---|
| 90 | * @return Account
|
---|
| 91 | * @throws \Google\Service\Exception
|
---|
| 92 | */
|
---|
| 93 | public function updateLabels($name, UpdateAccountLabelsRequest $postBody, $optParams = [])
|
---|
| 94 | {
|
---|
| 95 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 96 | $params = array_merge($params, $optParams);
|
---|
| 97 | return $this->call('updateLabels', [$params], Account::class);
|
---|
| 98 | }
|
---|
| 99 | }
|
---|
| 100 |
|
---|
| 101 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 102 | class_alias(Accounts::class, 'Google_Service_Css_Resource_Accounts');
|
---|