schemas
Creates, updates, deletes, gets or lists a schemas
resource.
Overview
Name | schemas |
Type | Resource |
Id | googleadmin.directory.schemas |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
displayName | string | Display name for the schema. |
etag | string | The ETag of the resource. |
fields | array | A list of fields in the schema. |
kind | string | Kind of resource this is. (default: admin#directory#schema) |
schemaId | string | The unique identifier of the schema (Read-only) |
schemaName | string | The schema's name. Each schema_name must be unique within a customer. Reusing a name results in a 409: Entity already exists error. |
Successful response
Name | Datatype | Description |
---|---|---|
etag | string | ETag of the resource. |
kind | string | Kind of resource this is. (default: admin#directory#schemas) |
schemas | array | A list of UserSchema objects. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | customerId , schemaKey | Retrieves a schema. | |
list | select | customerId | Retrieves all schemas for a customer. | |
insert | insert | customerId | Creates a schema. | |
patch | update | customerId , schemaKey | Patches a schema. | |
update | replace | customerId , schemaKey | Updates a schema. | |
delete | delete | customerId , schemaKey | Deletes a schema. |
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.
Name | Datatype | Description |
---|---|---|
customerId | string | |
schemaKey | string |
SELECT
examples
- get
- list
Retrieves a schema.
SELECT
displayName,
etag,
fields,
kind,
schemaId,
schemaName
FROM googleadmin.directory.schemas
WHERE customerId = '{{ customerId }}' -- required
AND schemaKey = '{{ schemaKey }}' -- required;
Retrieves all schemas for a customer.
SELECT
etag,
kind,
schemas
FROM googleadmin.directory.schemas
WHERE customerId = '{{ customerId }}' -- required;
INSERT
examples
- insert
- Manifest
Creates a schema.
INSERT INTO googleadmin.directory.schemas (
data__schemaId,
data__schemaName,
data__fields,
data__displayName,
data__kind,
data__etag,
customerId
)
SELECT
'{{ schemaId }}',
'{{ schemaName }}',
'{{ fields }}',
'{{ displayName }}',
'{{ kind }}',
'{{ etag }}',
'{{ customerId }}'
RETURNING
displayName,
etag,
fields,
kind,
schemaId,
schemaName
;
# Description fields are for documentation purposes
- name: schemas
props:
- name: customerId
value: string
description: Required parameter for the schemas resource.
- name: schemaId
value: string
description: >
The unique identifier of the schema (Read-only)
- name: schemaName
value: string
description: >
The schema's name. Each `schema_name` must be unique within a customer. Reusing a name results in a `409: Entity already exists` error.
- name: fields
value: array
description: >
A list of fields in the schema.
- name: displayName
value: string
description: >
Display name for the schema.
- name: kind
value: string
description: >
Kind of resource this is.
default: admin#directory#schema
- name: etag
value: string
description: >
The ETag of the resource.
UPDATE
examples
- patch
Patches a schema.
UPDATE googleadmin.directory.schemas
SET
data__schemaId = '{{ schemaId }}',
data__schemaName = '{{ schemaName }}',
data__fields = '{{ fields }}',
data__displayName = '{{ displayName }}',
data__kind = '{{ kind }}',
data__etag = '{{ etag }}'
WHERE
customerId = '{{ customerId }}' --required
AND schemaKey = '{{ schemaKey }}' --required
RETURNING
displayName,
etag,
fields,
kind,
schemaId,
schemaName;
REPLACE
examples
- update
Updates a schema.
REPLACE googleadmin.directory.schemas
SET
data__schemaId = '{{ schemaId }}',
data__schemaName = '{{ schemaName }}',
data__fields = '{{ fields }}',
data__displayName = '{{ displayName }}',
data__kind = '{{ kind }}',
data__etag = '{{ etag }}'
WHERE
customerId = '{{ customerId }}' --required
AND schemaKey = '{{ schemaKey }}' --required
RETURNING
displayName,
etag,
fields,
kind,
schemaId,
schemaName;
DELETE
examples
- delete
Deletes a schema.
DELETE FROM googleadmin.directory.schemas
WHERE customerId = '{{ customerId }}' --required
AND schemaKey = '{{ schemaKey }}' --required;