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\Directory\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Directory\AdminEmpty;
|
---|
21 | use Google\Service\Directory\BatchCreatePrintersRequest;
|
---|
22 | use Google\Service\Directory\BatchCreatePrintersResponse;
|
---|
23 | use Google\Service\Directory\BatchDeletePrintersRequest;
|
---|
24 | use Google\Service\Directory\BatchDeletePrintersResponse;
|
---|
25 | use Google\Service\Directory\ListPrinterModelsResponse;
|
---|
26 | use Google\Service\Directory\ListPrintersResponse;
|
---|
27 | use Google\Service\Directory\Printer;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * The "printers" collection of methods.
|
---|
31 | * Typical usage is:
|
---|
32 | * <code>
|
---|
33 | * $adminService = new Google\Service\Directory(...);
|
---|
34 | * $printers = $adminService->customers_chrome_printers;
|
---|
35 | * </code>
|
---|
36 | */
|
---|
37 | class CustomersChromePrinters extends \Google\Service\Resource
|
---|
38 | {
|
---|
39 | /**
|
---|
40 | * Creates printers under given Organization Unit.
|
---|
41 | * (printers.batchCreatePrinters)
|
---|
42 | *
|
---|
43 | * @param string $parent Required. The name of the customer. Format:
|
---|
44 | * customers/{customer_id}
|
---|
45 | * @param BatchCreatePrintersRequest $postBody
|
---|
46 | * @param array $optParams Optional parameters.
|
---|
47 | * @return BatchCreatePrintersResponse
|
---|
48 | * @throws \Google\Service\Exception
|
---|
49 | */
|
---|
50 | public function batchCreatePrinters($parent, BatchCreatePrintersRequest $postBody, $optParams = [])
|
---|
51 | {
|
---|
52 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
53 | $params = array_merge($params, $optParams);
|
---|
54 | return $this->call('batchCreatePrinters', [$params], BatchCreatePrintersResponse::class);
|
---|
55 | }
|
---|
56 | /**
|
---|
57 | * Deletes printers in batch. (printers.batchDeletePrinters)
|
---|
58 | *
|
---|
59 | * @param string $parent Required. The name of the customer. Format:
|
---|
60 | * customers/{customer_id}
|
---|
61 | * @param BatchDeletePrintersRequest $postBody
|
---|
62 | * @param array $optParams Optional parameters.
|
---|
63 | * @return BatchDeletePrintersResponse
|
---|
64 | * @throws \Google\Service\Exception
|
---|
65 | */
|
---|
66 | public function batchDeletePrinters($parent, BatchDeletePrintersRequest $postBody, $optParams = [])
|
---|
67 | {
|
---|
68 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
69 | $params = array_merge($params, $optParams);
|
---|
70 | return $this->call('batchDeletePrinters', [$params], BatchDeletePrintersResponse::class);
|
---|
71 | }
|
---|
72 | /**
|
---|
73 | * Creates a printer under given Organization Unit. (printers.create)
|
---|
74 | *
|
---|
75 | * @param string $parent Required. The name of the customer. Format:
|
---|
76 | * customers/{customer_id}
|
---|
77 | * @param Printer $postBody
|
---|
78 | * @param array $optParams Optional parameters.
|
---|
79 | * @return Printer
|
---|
80 | * @throws \Google\Service\Exception
|
---|
81 | */
|
---|
82 | public function create($parent, Printer $postBody, $optParams = [])
|
---|
83 | {
|
---|
84 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
85 | $params = array_merge($params, $optParams);
|
---|
86 | return $this->call('create', [$params], Printer::class);
|
---|
87 | }
|
---|
88 | /**
|
---|
89 | * Deletes a `Printer`. (printers.delete)
|
---|
90 | *
|
---|
91 | * @param string $name Required. The name of the printer to be updated. Format:
|
---|
92 | * customers/{customer_id}/chrome/printers/{printer_id}
|
---|
93 | * @param array $optParams Optional parameters.
|
---|
94 | * @return AdminEmpty
|
---|
95 | * @throws \Google\Service\Exception
|
---|
96 | */
|
---|
97 | public function delete($name, $optParams = [])
|
---|
98 | {
|
---|
99 | $params = ['name' => $name];
|
---|
100 | $params = array_merge($params, $optParams);
|
---|
101 | return $this->call('delete', [$params], AdminEmpty::class);
|
---|
102 | }
|
---|
103 | /**
|
---|
104 | * Returns a `Printer` resource (printer's config). (printers.get)
|
---|
105 | *
|
---|
106 | * @param string $name Required. The name of the printer to retrieve. Format:
|
---|
107 | * customers/{customer_id}/chrome/printers/{printer_id}
|
---|
108 | * @param array $optParams Optional parameters.
|
---|
109 | * @return Printer
|
---|
110 | * @throws \Google\Service\Exception
|
---|
111 | */
|
---|
112 | public function get($name, $optParams = [])
|
---|
113 | {
|
---|
114 | $params = ['name' => $name];
|
---|
115 | $params = array_merge($params, $optParams);
|
---|
116 | return $this->call('get', [$params], Printer::class);
|
---|
117 | }
|
---|
118 | /**
|
---|
119 | * List printers configs. (printers.listCustomersChromePrinters)
|
---|
120 | *
|
---|
121 | * @param string $parent Required. The name of the customer who owns this
|
---|
122 | * collection of printers. Format: customers/{customer_id}
|
---|
123 | * @param array $optParams Optional parameters.
|
---|
124 | *
|
---|
125 | * @opt_param string filter Search query. Search syntax is shared between this
|
---|
126 | * api and Admin Console printers pages.
|
---|
127 | * @opt_param string orderBy The order to sort results by. Must be one of
|
---|
128 | * display_name, description, make_and_model, or create_time. Default order is
|
---|
129 | * ascending, but descending order can be returned by appending "desc" to the
|
---|
130 | * order_by field. For instance, "description desc" will return the printers
|
---|
131 | * sorted by description in descending order.
|
---|
132 | * @opt_param string orgUnitId Organization Unit that we want to list the
|
---|
133 | * printers for. When org_unit is not present in the request then all printers
|
---|
134 | * of the customer are returned (or filtered). When org_unit is present in the
|
---|
135 | * request then only printers available to this OU will be returned (owned or
|
---|
136 | * inherited). You may see if printer is owned or inherited for this OU by
|
---|
137 | * looking at Printer.org_unit_id.
|
---|
138 | * @opt_param int pageSize The maximum number of objects to return. The service
|
---|
139 | * may return fewer than this value.
|
---|
140 | * @opt_param string pageToken A page token, received from a previous call.
|
---|
141 | * @return ListPrintersResponse
|
---|
142 | * @throws \Google\Service\Exception
|
---|
143 | */
|
---|
144 | public function listCustomersChromePrinters($parent, $optParams = [])
|
---|
145 | {
|
---|
146 | $params = ['parent' => $parent];
|
---|
147 | $params = array_merge($params, $optParams);
|
---|
148 | return $this->call('list', [$params], ListPrintersResponse::class);
|
---|
149 | }
|
---|
150 | /**
|
---|
151 | * Lists the supported printer models. (printers.listPrinterModels)
|
---|
152 | *
|
---|
153 | * @param string $parent Required. The name of the customer who owns this
|
---|
154 | * collection of printers. Format: customers/{customer_id}
|
---|
155 | * @param array $optParams Optional parameters.
|
---|
156 | *
|
---|
157 | * @opt_param string filter Filer to list only models by a given manufacturer in
|
---|
158 | * format: "manufacturer:Brother". Search syntax is shared between this api and
|
---|
159 | * Admin Console printers pages.
|
---|
160 | * @opt_param int pageSize The maximum number of objects to return. The service
|
---|
161 | * may return fewer than this value.
|
---|
162 | * @opt_param string pageToken A page token, received from a previous call.
|
---|
163 | * @return ListPrinterModelsResponse
|
---|
164 | * @throws \Google\Service\Exception
|
---|
165 | */
|
---|
166 | public function listPrinterModels($parent, $optParams = [])
|
---|
167 | {
|
---|
168 | $params = ['parent' => $parent];
|
---|
169 | $params = array_merge($params, $optParams);
|
---|
170 | return $this->call('listPrinterModels', [$params], ListPrinterModelsResponse::class);
|
---|
171 | }
|
---|
172 | /**
|
---|
173 | * Updates a `Printer` resource. (printers.patch)
|
---|
174 | *
|
---|
175 | * @param string $name The resource name of the Printer object, in the format
|
---|
176 | * customers/{customer-id}/printers/{printer-id} (During printer creation leave
|
---|
177 | * empty)
|
---|
178 | * @param Printer $postBody
|
---|
179 | * @param array $optParams Optional parameters.
|
---|
180 | *
|
---|
181 | * @opt_param string clearMask The list of fields to be cleared. Note, some of
|
---|
182 | * the fields are read only and cannot be updated. Values for not specified
|
---|
183 | * fields will be patched.
|
---|
184 | * @opt_param string updateMask The list of fields to be updated. Note, some of
|
---|
185 | * the fields are read only and cannot be updated. Values for not specified
|
---|
186 | * fields will be patched.
|
---|
187 | * @return Printer
|
---|
188 | * @throws \Google\Service\Exception
|
---|
189 | */
|
---|
190 | public function patch($name, Printer $postBody, $optParams = [])
|
---|
191 | {
|
---|
192 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
193 | $params = array_merge($params, $optParams);
|
---|
194 | return $this->call('patch', [$params], Printer::class);
|
---|
195 | }
|
---|
196 | }
|
---|
197 |
|
---|
198 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
199 | class_alias(CustomersChromePrinters::class, 'Google_Service_Directory_Resource_CustomersChromePrinters');
|
---|