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\Cloudchannel\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Cloudchannel\GoogleCloudChannelV1CheckCloudIdentityAccountsExistRequest;
|
---|
21 | use Google\Service\Cloudchannel\GoogleCloudChannelV1CheckCloudIdentityAccountsExistResponse;
|
---|
22 | use Google\Service\Cloudchannel\GoogleCloudChannelV1ListSubscribersResponse;
|
---|
23 | use Google\Service\Cloudchannel\GoogleCloudChannelV1ListTransferableOffersRequest;
|
---|
24 | use Google\Service\Cloudchannel\GoogleCloudChannelV1ListTransferableOffersResponse;
|
---|
25 | use Google\Service\Cloudchannel\GoogleCloudChannelV1ListTransferableSkusRequest;
|
---|
26 | use Google\Service\Cloudchannel\GoogleCloudChannelV1ListTransferableSkusResponse;
|
---|
27 | use Google\Service\Cloudchannel\GoogleCloudChannelV1RegisterSubscriberRequest;
|
---|
28 | use Google\Service\Cloudchannel\GoogleCloudChannelV1RegisterSubscriberResponse;
|
---|
29 | use Google\Service\Cloudchannel\GoogleCloudChannelV1UnregisterSubscriberRequest;
|
---|
30 | use Google\Service\Cloudchannel\GoogleCloudChannelV1UnregisterSubscriberResponse;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * The "accounts" collection of methods.
|
---|
34 | * Typical usage is:
|
---|
35 | * <code>
|
---|
36 | * $cloudchannelService = new Google\Service\Cloudchannel(...);
|
---|
37 | * $accounts = $cloudchannelService->accounts;
|
---|
38 | * </code>
|
---|
39 | */
|
---|
40 | class Accounts extends \Google\Service\Resource
|
---|
41 | {
|
---|
42 | /**
|
---|
43 | * Confirms the existence of Cloud Identity accounts based on the domain and if
|
---|
44 | * the Cloud Identity accounts are owned by the reseller. Possible error codes:
|
---|
45 | * * PERMISSION_DENIED: The reseller account making the request is different
|
---|
46 | * from the reseller account in the API request. * INVALID_ARGUMENT: Required
|
---|
47 | * request parameters are missing or invalid. * INVALID_VALUE: Invalid domain
|
---|
48 | * value in the request. Return value: A list of CloudIdentityCustomerAccount
|
---|
49 | * resources for the domain (may be empty) Note: in the v1alpha1 version of the
|
---|
50 | * API, a NOT_FOUND error returns if no CloudIdentityCustomerAccount resources
|
---|
51 | * match the domain. (accounts.checkCloudIdentityAccountsExist)
|
---|
52 | *
|
---|
53 | * @param string $parent Required. The reseller account's resource name. Parent
|
---|
54 | * uses the format: accounts/{account_id}
|
---|
55 | * @param GoogleCloudChannelV1CheckCloudIdentityAccountsExistRequest $postBody
|
---|
56 | * @param array $optParams Optional parameters.
|
---|
57 | * @return GoogleCloudChannelV1CheckCloudIdentityAccountsExistResponse
|
---|
58 | * @throws \Google\Service\Exception
|
---|
59 | */
|
---|
60 | public function checkCloudIdentityAccountsExist($parent, GoogleCloudChannelV1CheckCloudIdentityAccountsExistRequest $postBody, $optParams = [])
|
---|
61 | {
|
---|
62 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
63 | $params = array_merge($params, $optParams);
|
---|
64 | return $this->call('checkCloudIdentityAccountsExist', [$params], GoogleCloudChannelV1CheckCloudIdentityAccountsExistResponse::class);
|
---|
65 | }
|
---|
66 | /**
|
---|
67 | * Lists service accounts with subscriber privileges on the Pub/Sub topic
|
---|
68 | * created for this Channel Services account or integrator. Possible error
|
---|
69 | * codes: * PERMISSION_DENIED: The reseller account making the request and the
|
---|
70 | * provided reseller account are different, or the impersonated user is not a
|
---|
71 | * super admin. * INVALID_ARGUMENT: Required request parameters are missing or
|
---|
72 | * invalid. * NOT_FOUND: The topic resource doesn't exist. * INTERNAL: Any non-
|
---|
73 | * user error related to a technical issue in the backend. Contact Cloud Channel
|
---|
74 | * support. * UNKNOWN: Any non-user error related to a technical issue in the
|
---|
75 | * backend. Contact Cloud Channel support. Return value: A list of service email
|
---|
76 | * addresses. (accounts.listSubscribers)
|
---|
77 | *
|
---|
78 | * @param string $account Optional. Resource name of the account. Required if
|
---|
79 | * integrator is not provided. Otherwise, leave this field empty/unset.
|
---|
80 | * @param array $optParams Optional parameters.
|
---|
81 | *
|
---|
82 | * @opt_param string integrator Optional. Resource name of the integrator.
|
---|
83 | * Required if account is not provided. Otherwise, leave this field empty/unset.
|
---|
84 | * @opt_param int pageSize Optional. The maximum number of service accounts to
|
---|
85 | * return. The service may return fewer than this value. If unspecified, returns
|
---|
86 | * at most 100 service accounts. The maximum value is 1000; the server will
|
---|
87 | * coerce values above 1000.
|
---|
88 | * @opt_param string pageToken Optional. A page token, received from a previous
|
---|
89 | * `ListSubscribers` call. Provide this to retrieve the subsequent page. When
|
---|
90 | * paginating, all other parameters provided to `ListSubscribers` must match the
|
---|
91 | * call that provided the page token.
|
---|
92 | * @return GoogleCloudChannelV1ListSubscribersResponse
|
---|
93 | * @throws \Google\Service\Exception
|
---|
94 | */
|
---|
95 | public function listSubscribers($account, $optParams = [])
|
---|
96 | {
|
---|
97 | $params = ['account' => $account];
|
---|
98 | $params = array_merge($params, $optParams);
|
---|
99 | return $this->call('listSubscribers', [$params], GoogleCloudChannelV1ListSubscribersResponse::class);
|
---|
100 | }
|
---|
101 | /**
|
---|
102 | * List TransferableOffers of a customer based on Cloud Identity ID or Customer
|
---|
103 | * Name in the request. Use this method when a reseller gets the entitlement
|
---|
104 | * information of an unowned customer. The reseller should provide the
|
---|
105 | * customer's Cloud Identity ID or Customer Name. Possible error codes: *
|
---|
106 | * PERMISSION_DENIED: * The customer doesn't belong to the reseller and has no
|
---|
107 | * auth token. * The customer provided incorrect reseller information when
|
---|
108 | * generating auth token. * The reseller account making the request is different
|
---|
109 | * from the reseller account in the query. * The reseller is not authorized to
|
---|
110 | * transact on this Product. See
|
---|
111 | * https://support.google.com/channelservices/answer/9759265 * INVALID_ARGUMENT:
|
---|
112 | * Required request parameters are missing or invalid. Return value: List of
|
---|
113 | * TransferableOffer for the given customer and SKU.
|
---|
114 | * (accounts.listTransferableOffers)
|
---|
115 | *
|
---|
116 | * @param string $parent Required. The resource name of the reseller's account.
|
---|
117 | * @param GoogleCloudChannelV1ListTransferableOffersRequest $postBody
|
---|
118 | * @param array $optParams Optional parameters.
|
---|
119 | * @return GoogleCloudChannelV1ListTransferableOffersResponse
|
---|
120 | * @throws \Google\Service\Exception
|
---|
121 | */
|
---|
122 | public function listTransferableOffers($parent, GoogleCloudChannelV1ListTransferableOffersRequest $postBody, $optParams = [])
|
---|
123 | {
|
---|
124 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
125 | $params = array_merge($params, $optParams);
|
---|
126 | return $this->call('listTransferableOffers', [$params], GoogleCloudChannelV1ListTransferableOffersResponse::class);
|
---|
127 | }
|
---|
128 | /**
|
---|
129 | * List TransferableSkus of a customer based on the Cloud Identity ID or
|
---|
130 | * Customer Name in the request. Use this method to list the entitlements
|
---|
131 | * information of an unowned customer. You should provide the customer's Cloud
|
---|
132 | * Identity ID or Customer Name. Possible error codes: * PERMISSION_DENIED: *
|
---|
133 | * The customer doesn't belong to the reseller and has no auth token. * The
|
---|
134 | * supplied auth token is invalid. * The reseller account making the request is
|
---|
135 | * different from the reseller account in the query. * INVALID_ARGUMENT:
|
---|
136 | * Required request parameters are missing or invalid. Return value: A list of
|
---|
137 | * the customer's TransferableSku. (accounts.listTransferableSkus)
|
---|
138 | *
|
---|
139 | * @param string $parent Required. The reseller account's resource name. Parent
|
---|
140 | * uses the format: accounts/{account_id}
|
---|
141 | * @param GoogleCloudChannelV1ListTransferableSkusRequest $postBody
|
---|
142 | * @param array $optParams Optional parameters.
|
---|
143 | * @return GoogleCloudChannelV1ListTransferableSkusResponse
|
---|
144 | * @throws \Google\Service\Exception
|
---|
145 | */
|
---|
146 | public function listTransferableSkus($parent, GoogleCloudChannelV1ListTransferableSkusRequest $postBody, $optParams = [])
|
---|
147 | {
|
---|
148 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
149 | $params = array_merge($params, $optParams);
|
---|
150 | return $this->call('listTransferableSkus', [$params], GoogleCloudChannelV1ListTransferableSkusResponse::class);
|
---|
151 | }
|
---|
152 | /**
|
---|
153 | * Registers a service account with subscriber privileges on the Pub/Sub topic
|
---|
154 | * for this Channel Services account or integrator. After you create a
|
---|
155 | * subscriber, you get the events through SubscriberEvent Possible error codes:
|
---|
156 | * * PERMISSION_DENIED: The reseller account making the request and the provided
|
---|
157 | * reseller account are different, or the impersonated user is not a super
|
---|
158 | * admin. * INVALID_ARGUMENT: Required request parameters are missing or
|
---|
159 | * invalid. * INTERNAL: Any non-user error related to a technical issue in the
|
---|
160 | * backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related
|
---|
161 | * to a technical issue in the backend. Contact Cloud Channel support. Return
|
---|
162 | * value: The topic name with the registered service email address.
|
---|
163 | * (accounts.register)
|
---|
164 | *
|
---|
165 | * @param string $account Optional. Resource name of the account. Required if
|
---|
166 | * integrator is not provided. Otherwise, leave this field empty/unset.
|
---|
167 | * @param GoogleCloudChannelV1RegisterSubscriberRequest $postBody
|
---|
168 | * @param array $optParams Optional parameters.
|
---|
169 | * @return GoogleCloudChannelV1RegisterSubscriberResponse
|
---|
170 | * @throws \Google\Service\Exception
|
---|
171 | */
|
---|
172 | public function register($account, GoogleCloudChannelV1RegisterSubscriberRequest $postBody, $optParams = [])
|
---|
173 | {
|
---|
174 | $params = ['account' => $account, 'postBody' => $postBody];
|
---|
175 | $params = array_merge($params, $optParams);
|
---|
176 | return $this->call('register', [$params], GoogleCloudChannelV1RegisterSubscriberResponse::class);
|
---|
177 | }
|
---|
178 | /**
|
---|
179 | * Unregisters a service account with subscriber privileges on the Pub/Sub topic
|
---|
180 | * created for this Channel Services account or integrator. If there are no
|
---|
181 | * service accounts left with subscriber privileges, this deletes the topic. You
|
---|
182 | * can call ListSubscribers to check for these accounts. Possible error codes: *
|
---|
183 | * PERMISSION_DENIED: The reseller account making the request and the provided
|
---|
184 | * reseller account are different, or the impersonated user is not a super
|
---|
185 | * admin. * INVALID_ARGUMENT: Required request parameters are missing or
|
---|
186 | * invalid. * NOT_FOUND: The topic resource doesn't exist. * INTERNAL: Any non-
|
---|
187 | * user error related to a technical issue in the backend. Contact Cloud Channel
|
---|
188 | * support. * UNKNOWN: Any non-user error related to a technical issue in the
|
---|
189 | * backend. Contact Cloud Channel support. Return value: The topic name that
|
---|
190 | * unregistered the service email address. Returns a success response if the
|
---|
191 | * service email address wasn't registered with the topic. (accounts.unregister)
|
---|
192 | *
|
---|
193 | * @param string $account Optional. Resource name of the account. Required if
|
---|
194 | * integrator is not provided. Otherwise, leave this field empty/unset.
|
---|
195 | * @param GoogleCloudChannelV1UnregisterSubscriberRequest $postBody
|
---|
196 | * @param array $optParams Optional parameters.
|
---|
197 | * @return GoogleCloudChannelV1UnregisterSubscriberResponse
|
---|
198 | * @throws \Google\Service\Exception
|
---|
199 | */
|
---|
200 | public function unregister($account, GoogleCloudChannelV1UnregisterSubscriberRequest $postBody, $optParams = [])
|
---|
201 | {
|
---|
202 | $params = ['account' => $account, 'postBody' => $postBody];
|
---|
203 | $params = array_merge($params, $optParams);
|
---|
204 | return $this->call('unregister', [$params], GoogleCloudChannelV1UnregisterSubscriberResponse::class);
|
---|
205 | }
|
---|
206 | }
|
---|
207 |
|
---|
208 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
209 | class_alias(Accounts::class, 'Google_Service_Cloudchannel_Resource_Accounts');
|
---|