Skip to main content

printers

Creates, updates, deletes, gets or lists a printers resource.

Overview

Nameprinters
TypeResource
Idgoogleadmin.directory.printers

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
idstringId of the printer. (During printer creation leave empty)
namestringIdentifier. The resource name of the Printer object, in the format customers/{customer-id}/printers/{printer-id} (During printer creation leave empty)
auxiliaryMessagesarrayOutput only. Auxiliary messages about issues with the printer configuration if any.
createTimestring (google-datetime)Output only. Time when printer was created.
descriptionstringEditable. Description of printer.
displayNamestringEditable. Name of printer.
makeAndModelstringEditable. Make and model of printer. e.g. Lexmark MS610de Value must be in format as seen in ListPrinterModels response.
orgUnitIdstringOrganization Unit that owns this printer (Only can be set during Printer creation)
uristringEditable. Printer URI.
useDriverlessConfigbooleanEditable. flag to use driverless configuration or not. If it's set to be true, make_and_model can be ignored

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcustomersId, printersIdReturns a Printer resource (printer's config).
listselectcustomersIdpageSize, pageToken, orgUnitId, filter, orderByList printers configs.
createinsertcustomersIdCreates a printer under given Organization Unit.
batch_create_printersinsertcustomersIdCreates printers under given Organization Unit.
patchupdatecustomersId, printersIdupdateMask, clearMaskUpdates a Printer resource.
deletedeletecustomersId, printersIdDeletes a Printer.
batch_delete_printersdeletecustomersIdDeletes printers in batch.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
customersIdstring
printersIdstring
clearMaskstring (google-fieldmask)
filterstring
orderBystring
orgUnitIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Returns a Printer resource (printer's config).

SELECT
id,
name,
auxiliaryMessages,
createTime,
description,
displayName,
makeAndModel,
orgUnitId,
uri,
useDriverlessConfig
FROM googleadmin.directory.printers
WHERE customersId = '{{ customersId }}' -- required
AND printersId = '{{ printersId }}' -- required;

INSERT examples

Creates a printer under given Organization Unit.

INSERT INTO googleadmin.directory.printers (
data__name,
data__id,
data__displayName,
data__description,
data__makeAndModel,
data__uri,
data__orgUnitId,
data__useDriverlessConfig,
customersId
)
SELECT
'{{ name }}',
'{{ id }}',
'{{ displayName }}',
'{{ description }}',
'{{ makeAndModel }}',
'{{ uri }}',
'{{ orgUnitId }}',
{{ useDriverlessConfig }},
'{{ customersId }}'
RETURNING
id,
name,
auxiliaryMessages,
createTime,
description,
displayName,
makeAndModel,
orgUnitId,
uri,
useDriverlessConfig
;

UPDATE examples

Updates a Printer resource.

UPDATE googleadmin.directory.printers
SET
data__name = '{{ name }}',
data__id = '{{ id }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__makeAndModel = '{{ makeAndModel }}',
data__uri = '{{ uri }}',
data__orgUnitId = '{{ orgUnitId }}',
data__useDriverlessConfig = {{ useDriverlessConfig }}
WHERE
customersId = '{{ customersId }}' --required
AND printersId = '{{ printersId }}' --required
AND updateMask = '{{ updateMask}}'
AND clearMask = '{{ clearMask}}'
RETURNING
id,
name,
auxiliaryMessages,
createTime,
description,
displayName,
makeAndModel,
orgUnitId,
uri,
useDriverlessConfig;

DELETE examples

Deletes a Printer.

DELETE FROM googleadmin.directory.printers
WHERE customersId = '{{ customersId }}' --required
AND printersId = '{{ printersId }}' --required;