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\CloudCommercePartnerProcurementService\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudCommercePartnerProcurementService\Account;
|
---|
21 | use Google\Service\CloudCommercePartnerProcurementService\ApproveAccountRequest;
|
---|
22 | use Google\Service\CloudCommercePartnerProcurementService\CloudcommerceprocurementEmpty;
|
---|
23 | use Google\Service\CloudCommercePartnerProcurementService\ListAccountsResponse;
|
---|
24 | use Google\Service\CloudCommercePartnerProcurementService\RejectAccountRequest;
|
---|
25 | use Google\Service\CloudCommercePartnerProcurementService\ResetAccountRequest;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * The "accounts" collection of methods.
|
---|
29 | * Typical usage is:
|
---|
30 | * <code>
|
---|
31 | * $cloudcommerceprocurementService = new Google\Service\CloudCommercePartnerProcurementService(...);
|
---|
32 | * $accounts = $cloudcommerceprocurementService->providers_accounts;
|
---|
33 | * </code>
|
---|
34 | */
|
---|
35 | class ProvidersAccounts extends \Google\Service\Resource
|
---|
36 | {
|
---|
37 | /**
|
---|
38 | * Grants an approval on an Account. (accounts.approve)
|
---|
39 | *
|
---|
40 | * @param string $name Required. The resource name of the account, with the
|
---|
41 | * format `providers/{providerId}/accounts/{accountId}`.
|
---|
42 | * @param ApproveAccountRequest $postBody
|
---|
43 | * @param array $optParams Optional parameters.
|
---|
44 | * @return CloudcommerceprocurementEmpty
|
---|
45 | * @throws \Google\Service\Exception
|
---|
46 | */
|
---|
47 | public function approve($name, ApproveAccountRequest $postBody, $optParams = [])
|
---|
48 | {
|
---|
49 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
50 | $params = array_merge($params, $optParams);
|
---|
51 | return $this->call('approve', [$params], CloudcommerceprocurementEmpty::class);
|
---|
52 | }
|
---|
53 | /**
|
---|
54 | * Gets a requested Account resource. (accounts.get)
|
---|
55 | *
|
---|
56 | * @param string $name Required. The name of the account to retrieve.
|
---|
57 | * @param array $optParams Optional parameters.
|
---|
58 | * @return Account
|
---|
59 | * @throws \Google\Service\Exception
|
---|
60 | */
|
---|
61 | public function get($name, $optParams = [])
|
---|
62 | {
|
---|
63 | $params = ['name' => $name];
|
---|
64 | $params = array_merge($params, $optParams);
|
---|
65 | return $this->call('get', [$params], Account::class);
|
---|
66 | }
|
---|
67 | /**
|
---|
68 | * Lists Accounts that the provider has access to.
|
---|
69 | * (accounts.listProvidersAccounts)
|
---|
70 | *
|
---|
71 | * @param string $parent Required. The parent resource name.
|
---|
72 | * @param array $optParams Optional parameters.
|
---|
73 | *
|
---|
74 | * @opt_param int pageSize The maximum number of entries that are requested. The
|
---|
75 | * default page size is 25 and the maximum page size is 200.
|
---|
76 | * @opt_param string pageToken The token for fetching the next page.
|
---|
77 | * @return ListAccountsResponse
|
---|
78 | * @throws \Google\Service\Exception
|
---|
79 | */
|
---|
80 | public function listProvidersAccounts($parent, $optParams = [])
|
---|
81 | {
|
---|
82 | $params = ['parent' => $parent];
|
---|
83 | $params = array_merge($params, $optParams);
|
---|
84 | return $this->call('list', [$params], ListAccountsResponse::class);
|
---|
85 | }
|
---|
86 | /**
|
---|
87 | * Rejects an approval on an Account. (accounts.reject)
|
---|
88 | *
|
---|
89 | * @param string $name Required. The resource name of the account.
|
---|
90 | * @param RejectAccountRequest $postBody
|
---|
91 | * @param array $optParams Optional parameters.
|
---|
92 | * @return CloudcommerceprocurementEmpty
|
---|
93 | * @throws \Google\Service\Exception
|
---|
94 | */
|
---|
95 | public function reject($name, RejectAccountRequest $postBody, $optParams = [])
|
---|
96 | {
|
---|
97 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
98 | $params = array_merge($params, $optParams);
|
---|
99 | return $this->call('reject', [$params], CloudcommerceprocurementEmpty::class);
|
---|
100 | }
|
---|
101 | /**
|
---|
102 | * Resets an Account and cancels all associated Entitlements. Partner can only
|
---|
103 | * reset accounts they own rather than customer accounts. (accounts.reset)
|
---|
104 | *
|
---|
105 | * @param string $name Required. The resource name of the account.
|
---|
106 | * @param ResetAccountRequest $postBody
|
---|
107 | * @param array $optParams Optional parameters.
|
---|
108 | * @return CloudcommerceprocurementEmpty
|
---|
109 | * @throws \Google\Service\Exception
|
---|
110 | */
|
---|
111 | public function reset($name, ResetAccountRequest $postBody, $optParams = [])
|
---|
112 | {
|
---|
113 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
114 | $params = array_merge($params, $optParams);
|
---|
115 | return $this->call('reset', [$params], CloudcommerceprocurementEmpty::class);
|
---|
116 | }
|
---|
117 | }
|
---|
118 |
|
---|
119 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
120 | class_alias(ProvidersAccounts::class, 'Google_Service_CloudCommercePartnerProcurementService_Resource_ProvidersAccounts');
|
---|