users_settings
Creates, updates, deletes, gets or lists a users_settings resource.
Overview
| Name | users_settings |
| Type | Resource |
| Id | google.health.users_settings |
Fields
The following fields are returned by SELECT queries:
- get_settings
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The resource name of this Settings resource. Format: users/{user}/settings Example: users/1234567890/settings or users/me/settings The {user} ID is a system-generated Google Health API user ID, a string of 1-63 characters consisting of lowercase and uppercase letters, numbers, and hyphens. The literal me can also be used to refer to the authenticated user. |
autoStrideEnabled | boolean | Optional. True if the user's stride length is determined automatically. Updates to this field are currently not supported. |
distanceUnit | string | Optional. The measurement unit defined in the user's account settings. Updates to this field are currently not supported. (DISTANCE_UNIT_UNSPECIFIED, DISTANCE_UNIT_MILES, DISTANCE_UNIT_KILOMETERS) |
foodLanguageCode | string | Output only. The food language code derived from the user's food database. Possible values: 'en-US', 'en-GB', 'de-DE', 'es-ES', 'fr-FR', 'zh-CN', 'zh-TW', 'ja-JP', 'en-AU', 'en-CA', 'it-IT', 'ko-KR', 'es-MX', 'en-IN', 'en-SG', 'en-PH', 'en-IE', 'fr-CA'. Updates to this field are currently not supported. |
glucoseUnit | string | Optional. The measurement unit defined in the user's account settings. (GLUCOSE_UNIT_UNSPECIFIED, GLUCOSE_UNIT_MG_DL, GLUCOSE_UNIT_MMOL_L) |
heightUnit | string | Optional. The measurement unit defined in the user's account settings. (HEIGHT_UNIT_UNSPECIFIED, HEIGHT_UNIT_INCHES, HEIGHT_UNIT_CENTIMETERS) |
languageLocale | string | Optional. The locale defined in the user's account settings. Updates to this field are currently not supported. |
strideLengthRunningType | string | Optional. The stride length type defined in the user's account settings for running. Updates to this field are currently not supported. (STRIDE_LENGTH_TYPE_UNSPECIFIED, STRIDE_LENGTH_TYPE_DEFAULT, STRIDE_LENGTH_TYPE_MANUAL, STRIDE_LENGTH_TYPE_AUTO) |
strideLengthWalkingType | string | Optional. The stride length type defined in the user's account settings for walking. Updates to this field are currently not supported. (STRIDE_LENGTH_TYPE_UNSPECIFIED, STRIDE_LENGTH_TYPE_DEFAULT, STRIDE_LENGTH_TYPE_MANUAL, STRIDE_LENGTH_TYPE_AUTO) |
swimUnit | string | Optional. The measurement unit defined in the user's account settings. (SWIM_UNIT_UNSPECIFIED, SWIM_UNIT_METERS, SWIM_UNIT_YARDS) |
temperatureUnit | string | Optional. The measurement unit defined in the user's account settings. (TEMPERATURE_UNIT_UNSPECIFIED, TEMPERATURE_UNIT_CELSIUS, TEMPERATURE_UNIT_FAHRENHEIT) |
timeZone | string | Optional. The timezone defined in the user's account settings. This follows the IANA Time Zone Database. Updates to this field are currently not supported. |
utcOffset | string (google-duration) | Optional. The user's timezone offset relative to UTC. Updates to this field are currently not supported. |
waterUnit | string | Optional. The measurement unit defined in the user's account settings. (WATER_UNIT_UNSPECIFIED, WATER_UNIT_ML, WATER_UNIT_FL_OZ, WATER_UNIT_CUP) |
weightUnit | string | Optional. The measurement unit defined in the user's account settings. (WEIGHT_UNIT_UNSPECIFIED, WEIGHT_UNIT_POUNDS, WEIGHT_UNIT_STONE, WEIGHT_UNIT_KILOGRAMS) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_settings | select | usersId | Returns user settings details. | |
update_settings | update | usersId | updateMask | Updates the user's settings details. |
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 |
|---|---|---|
usersId | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- get_settings
Returns user settings details.
SELECT
name,
autoStrideEnabled,
distanceUnit,
foodLanguageCode,
glucoseUnit,
heightUnit,
languageLocale,
strideLengthRunningType,
strideLengthWalkingType,
swimUnit,
temperatureUnit,
timeZone,
utcOffset,
waterUnit,
weightUnit
FROM google.health.users_settings
WHERE usersId = '{{ usersId }}' -- required
;
UPDATE examples
- update_settings
Updates the user's settings details.
UPDATE google.health.users_settings
SET
data__strideLengthRunningType = '{{ strideLengthRunningType }}',
data__glucoseUnit = '{{ glucoseUnit }}',
data__distanceUnit = '{{ distanceUnit }}',
data__autoStrideEnabled = {{ autoStrideEnabled }},
data__languageLocale = '{{ languageLocale }}',
data__heightUnit = '{{ heightUnit }}',
data__strideLengthWalkingType = '{{ strideLengthWalkingType }}',
data__timeZone = '{{ timeZone }}',
data__waterUnit = '{{ waterUnit }}',
data__temperatureUnit = '{{ temperatureUnit }}',
data__utcOffset = '{{ utcOffset }}',
data__weightUnit = '{{ weightUnit }}',
data__name = '{{ name }}',
data__swimUnit = '{{ swimUnit }}'
WHERE
usersId = '{{ usersId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
autoStrideEnabled,
distanceUnit,
foodLanguageCode,
glucoseUnit,
heightUnit,
languageLocale,
strideLengthRunningType,
strideLengthWalkingType,
swimUnit,
temperatureUnit,
timeZone,
utcOffset,
waterUnit,
weightUnit;