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\AuthorizedBuyersMarketplace\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\AuthorizedBuyersMarketplace\ActivateClientRequest;
|
---|
21 | use Google\Service\AuthorizedBuyersMarketplace\Client;
|
---|
22 | use Google\Service\AuthorizedBuyersMarketplace\DeactivateClientRequest;
|
---|
23 | use Google\Service\AuthorizedBuyersMarketplace\ListClientsResponse;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "clients" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $authorizedbuyersmarketplaceService = new Google\Service\AuthorizedBuyersMarketplace(...);
|
---|
30 | * $clients = $authorizedbuyersmarketplaceService->buyers_clients;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class BuyersClients extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Activates an existing client. The state of the client will be updated to
|
---|
37 | * "ACTIVE". This method has no effect if the client is already in "ACTIVE"
|
---|
38 | * state. (clients.activate)
|
---|
39 | *
|
---|
40 | * @param string $name Required. Format:
|
---|
41 | * `buyers/{buyerAccountId}/clients/{clientAccountId}`
|
---|
42 | * @param ActivateClientRequest $postBody
|
---|
43 | * @param array $optParams Optional parameters.
|
---|
44 | * @return Client
|
---|
45 | * @throws \Google\Service\Exception
|
---|
46 | */
|
---|
47 | public function activate($name, ActivateClientRequest $postBody, $optParams = [])
|
---|
48 | {
|
---|
49 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
50 | $params = array_merge($params, $optParams);
|
---|
51 | return $this->call('activate', [$params], Client::class);
|
---|
52 | }
|
---|
53 | /**
|
---|
54 | * Creates a new client. (clients.create)
|
---|
55 | *
|
---|
56 | * @param string $parent Required. The name of the buyer. Format:
|
---|
57 | * `buyers/{accountId}`
|
---|
58 | * @param Client $postBody
|
---|
59 | * @param array $optParams Optional parameters.
|
---|
60 | * @return Client
|
---|
61 | * @throws \Google\Service\Exception
|
---|
62 | */
|
---|
63 | public function create($parent, Client $postBody, $optParams = [])
|
---|
64 | {
|
---|
65 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
66 | $params = array_merge($params, $optParams);
|
---|
67 | return $this->call('create', [$params], Client::class);
|
---|
68 | }
|
---|
69 | /**
|
---|
70 | * Deactivates an existing client. The state of the client will be updated to
|
---|
71 | * "INACTIVE". This method has no effect if the client is already in "INACTIVE"
|
---|
72 | * state. (clients.deactivate)
|
---|
73 | *
|
---|
74 | * @param string $name Required. Format:
|
---|
75 | * `buyers/{buyerAccountId}/clients/{clientAccountId}`
|
---|
76 | * @param DeactivateClientRequest $postBody
|
---|
77 | * @param array $optParams Optional parameters.
|
---|
78 | * @return Client
|
---|
79 | * @throws \Google\Service\Exception
|
---|
80 | */
|
---|
81 | public function deactivate($name, DeactivateClientRequest $postBody, $optParams = [])
|
---|
82 | {
|
---|
83 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
84 | $params = array_merge($params, $optParams);
|
---|
85 | return $this->call('deactivate', [$params], Client::class);
|
---|
86 | }
|
---|
87 | /**
|
---|
88 | * Gets a client with a given resource name. (clients.get)
|
---|
89 | *
|
---|
90 | * @param string $name Required. Format:
|
---|
91 | * `buyers/{accountId}/clients/{clientAccountId}`
|
---|
92 | * @param array $optParams Optional parameters.
|
---|
93 | * @return Client
|
---|
94 | * @throws \Google\Service\Exception
|
---|
95 | */
|
---|
96 | public function get($name, $optParams = [])
|
---|
97 | {
|
---|
98 | $params = ['name' => $name];
|
---|
99 | $params = array_merge($params, $optParams);
|
---|
100 | return $this->call('get', [$params], Client::class);
|
---|
101 | }
|
---|
102 | /**
|
---|
103 | * Lists all the clients for the current buyer. (clients.listBuyersClients)
|
---|
104 | *
|
---|
105 | * @param string $parent Required. The name of the buyer. Format:
|
---|
106 | * `buyers/{accountId}`
|
---|
107 | * @param array $optParams Optional parameters.
|
---|
108 | *
|
---|
109 | * @opt_param string filter Query string using the [Filtering
|
---|
110 | * Syntax](https://developers.google.com/authorized-buyers/apis/guides/list-
|
---|
111 | * filters) Supported fields for filtering are: * partnerClientId Use this field
|
---|
112 | * to filter the clients by the partnerClientId. For example, if the
|
---|
113 | * partnerClientId of the client is "1234", the value of this field should be
|
---|
114 | * `partnerClientId = "1234"`, in order to get only the client whose
|
---|
115 | * partnerClientId is "1234" in the response.
|
---|
116 | * @opt_param int pageSize Requested page size. If left blank, a default page
|
---|
117 | * size of 500 will be applied.
|
---|
118 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
119 | * should return. Typically, this is the value of
|
---|
120 | * ListClientsResponse.nextPageToken returned from the previous call to the list
|
---|
121 | * method.
|
---|
122 | * @return ListClientsResponse
|
---|
123 | * @throws \Google\Service\Exception
|
---|
124 | */
|
---|
125 | public function listBuyersClients($parent, $optParams = [])
|
---|
126 | {
|
---|
127 | $params = ['parent' => $parent];
|
---|
128 | $params = array_merge($params, $optParams);
|
---|
129 | return $this->call('list', [$params], ListClientsResponse::class);
|
---|
130 | }
|
---|
131 | /**
|
---|
132 | * Updates an existing client. (clients.patch)
|
---|
133 | *
|
---|
134 | * @param string $name Output only. The resource name of the client. Format:
|
---|
135 | * `buyers/{accountId}/clients/{clientAccountId}`
|
---|
136 | * @param Client $postBody
|
---|
137 | * @param array $optParams Optional parameters.
|
---|
138 | *
|
---|
139 | * @opt_param string updateMask List of fields to be updated. If empty or
|
---|
140 | * unspecified, the service will update all fields populated in the update
|
---|
141 | * request excluding the output only fields and primitive fields with default
|
---|
142 | * value. Note that explicit field mask is required in order to reset a
|
---|
143 | * primitive field back to its default value, for example, false for boolean
|
---|
144 | * fields, 0 for integer fields. A special field mask consisting of a single
|
---|
145 | * path "*" can be used to indicate full replacement(the equivalent of PUT
|
---|
146 | * method), updatable fields unset or unspecified in the input will be cleared
|
---|
147 | * or set to default value. Output only fields will be ignored regardless of the
|
---|
148 | * value of updateMask.
|
---|
149 | * @return Client
|
---|
150 | * @throws \Google\Service\Exception
|
---|
151 | */
|
---|
152 | public function patch($name, Client $postBody, $optParams = [])
|
---|
153 | {
|
---|
154 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
155 | $params = array_merge($params, $optParams);
|
---|
156 | return $this->call('patch', [$params], Client::class);
|
---|
157 | }
|
---|
158 | }
|
---|
159 |
|
---|
160 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
161 | class_alias(BuyersClients::class, 'Google_Service_AuthorizedBuyersMarketplace_Resource_BuyersClients');
|
---|