buildings
Creates, updates, deletes, gets or lists a buildings
resource.
Overview
Name | buildings |
Type | Resource |
Id | googleadmin.directory.buildings |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
address | object | The postal address of the building. See PostalAddress for details. Note that only a single address line and region code are required. (id: BuildingAddress) |
buildingId | string | Unique identifier for the building. The maximum length is 100 characters. |
buildingName | string | The building name as seen by users in Calendar. Must be unique for the customer. For example, "NYC-CHEL". The maximum length is 100 characters. |
coordinates | object | The geographic coordinates of the center of the building, expressed as latitude and longitude in decimal degrees. (id: BuildingCoordinates) |
description | string | A brief description of the building. For example, "Chelsea Market". |
etags | string | ETag of the resource. |
floorNames | array | The display names for all floors in this building. The floors are expected to be sorted in ascending order, from lowest floor to highest floor. For example, ["B2", "B1", "L", "1", "2", "2M", "3", "PH"] Must contain at least one entry. |
kind | string | Kind of resource this is. (default: admin#directory#resources#buildings#Building) |
Successful response
Name | Datatype | Description |
---|---|---|
address | object | The postal address of the building. See PostalAddress for details. Note that only a single address line and region code are required. (id: BuildingAddress) |
buildingId | string | Unique identifier for the building. The maximum length is 100 characters. |
buildingName | string | The building name as seen by users in Calendar. Must be unique for the customer. For example, "NYC-CHEL". The maximum length is 100 characters. |
coordinates | object | The geographic coordinates of the center of the building, expressed as latitude and longitude in decimal degrees. (id: BuildingCoordinates) |
description | string | A brief description of the building. For example, "Chelsea Market". |
etags | string | ETag of the resource. |
floorNames | array | The display names for all floors in this building. The floors are expected to be sorted in ascending order, from lowest floor to highest floor. For example, ["B2", "B1", "L", "1", "2", "2M", "3", "PH"] Must contain at least one entry. |
kind | string | Kind of resource this is. (default: admin#directory#resources#buildings#Building) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | customer , buildingId | Retrieves a building. | |
list | select | customer | maxResults , pageToken | Retrieves a list of buildings for an account. |
insert | insert | customer | coordinatesSource | Inserts a building. |
patch | update | customer , buildingId | coordinatesSource | Patches a building. |
update | replace | customer , buildingId | coordinatesSource | Updates a building. |
delete | delete | customer , buildingId | Deletes a building. |
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 |
---|---|---|
buildingId | string | |
customer | string | |
coordinatesSource | string | |
maxResults | integer (int32) | |
pageToken | string |
SELECT
examples
- get
- list
Retrieves a building.
SELECT
address,
buildingId,
buildingName,
coordinates,
description,
etags,
floorNames,
kind
FROM googleadmin.directory.buildings
WHERE customer = '{{ customer }}' -- required
AND buildingId = '{{ buildingId }}' -- required;
Retrieves a list of buildings for an account.
SELECT
address,
buildingId,
buildingName,
coordinates,
description,
etags,
floorNames,
kind
FROM googleadmin.directory.buildings
WHERE customer = '{{ customer }}' -- required
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- insert
- Manifest
Inserts a building.
INSERT INTO googleadmin.directory.buildings (
data__buildingId,
data__buildingName,
data__description,
data__coordinates,
data__kind,
data__etags,
data__floorNames,
data__address,
customer,
coordinatesSource
)
SELECT
'{{ buildingId }}',
'{{ buildingName }}',
'{{ description }}',
'{{ coordinates }}',
'{{ kind }}',
'{{ etags }}',
'{{ floorNames }}',
'{{ address }}',
'{{ customer }}',
'{{ coordinatesSource }}'
RETURNING
address,
buildingId,
buildingName,
coordinates,
description,
etags,
floorNames,
kind
;
# Description fields are for documentation purposes
- name: buildings
props:
- name: customer
value: string
description: Required parameter for the buildings resource.
- name: buildingId
value: string
description: >
Unique identifier for the building. The maximum length is 100 characters.
- name: buildingName
value: string
description: >
The building name as seen by users in Calendar. Must be unique for the customer. For example, "NYC-CHEL". The maximum length is 100 characters.
- name: description
value: string
description: >
A brief description of the building. For example, "Chelsea Market".
- name: coordinates
value: object
description: >
The geographic coordinates of the center of the building, expressed as latitude and longitude in decimal degrees.
- name: kind
value: string
description: >
Kind of resource this is.
default: admin#directory#resources#buildings#Building
- name: etags
value: string
description: >
ETag of the resource.
- name: floorNames
value: array
description: >
The display names for all floors in this building. The floors are expected to be sorted in ascending order, from lowest floor to highest floor. For example, ["B2", "B1", "L", "1", "2", "2M", "3", "PH"] Must contain at least one entry.
- name: address
value: object
description: >
The postal address of the building. See [`PostalAddress`](https://developers.google.com/my-business/reference/rest/v4/PostalAddress) for details. Note that only a single address line and region code are required.
- name: coordinatesSource
value: string
UPDATE
examples
- patch
Patches a building.
UPDATE googleadmin.directory.buildings
SET
data__buildingId = '{{ buildingId }}',
data__buildingName = '{{ buildingName }}',
data__description = '{{ description }}',
data__coordinates = '{{ coordinates }}',
data__kind = '{{ kind }}',
data__etags = '{{ etags }}',
data__floorNames = '{{ floorNames }}',
data__address = '{{ address }}'
WHERE
customer = '{{ customer }}' --required
AND buildingId = '{{ buildingId }}' --required
AND coordinatesSource = '{{ coordinatesSource}}'
RETURNING
address,
buildingId,
buildingName,
coordinates,
description,
etags,
floorNames,
kind;
REPLACE
examples
- update
Updates a building.
REPLACE googleadmin.directory.buildings
SET
data__buildingId = '{{ buildingId }}',
data__buildingName = '{{ buildingName }}',
data__description = '{{ description }}',
data__coordinates = '{{ coordinates }}',
data__kind = '{{ kind }}',
data__etags = '{{ etags }}',
data__floorNames = '{{ floorNames }}',
data__address = '{{ address }}'
WHERE
customer = '{{ customer }}' --required
AND buildingId = '{{ buildingId }}' --required
AND coordinatesSource = '{{ coordinatesSource}}'
RETURNING
address,
buildingId,
buildingName,
coordinates,
description,
etags,
floorNames,
kind;
DELETE
examples
- delete
Deletes a building.
DELETE FROM googleadmin.directory.buildings
WHERE customer = '{{ customer }}' --required
AND buildingId = '{{ buildingId }}' --required;