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