Skip to main content

users_settings

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

Overview

Nameusers_settings
TypeResource
Idgoogle.health.users_settings

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. 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.
autoStrideEnabledbooleanOptional. True if the user's stride length is determined automatically. Updates to this field are currently not supported.
distanceUnitstringOptional. 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)
foodLanguageCodestringOutput 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.
glucoseUnitstringOptional. The measurement unit defined in the user's account settings. (GLUCOSE_UNIT_UNSPECIFIED, GLUCOSE_UNIT_MG_DL, GLUCOSE_UNIT_MMOL_L)
heightUnitstringOptional. The measurement unit defined in the user's account settings. (HEIGHT_UNIT_UNSPECIFIED, HEIGHT_UNIT_INCHES, HEIGHT_UNIT_CENTIMETERS)
languageLocalestringOptional. The locale defined in the user's account settings. Updates to this field are currently not supported.
strideLengthRunningTypestringOptional. 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)
strideLengthWalkingTypestringOptional. 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)
swimUnitstringOptional. The measurement unit defined in the user's account settings. (SWIM_UNIT_UNSPECIFIED, SWIM_UNIT_METERS, SWIM_UNIT_YARDS)
temperatureUnitstringOptional. The measurement unit defined in the user's account settings. (TEMPERATURE_UNIT_UNSPECIFIED, TEMPERATURE_UNIT_CELSIUS, TEMPERATURE_UNIT_FAHRENHEIT)
timeZonestringOptional. The timezone defined in the user's account settings. This follows the IANA Time Zone Database. Updates to this field are currently not supported.
utcOffsetstring (google-duration)Optional. The user's timezone offset relative to UTC. Updates to this field are currently not supported.
waterUnitstringOptional. The measurement unit defined in the user's account settings. (WATER_UNIT_UNSPECIFIED, WATER_UNIT_ML, WATER_UNIT_FL_OZ, WATER_UNIT_CUP)
weightUnitstringOptional. 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:

NameAccessible byRequired ParamsOptional ParamsDescription
get_settingsselectusersIdReturns user settings details.
update_settingsupdateusersIdupdateMaskUpdates 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.

NameDatatypeDescription
usersIdstring
updateMaskstring (google-fieldmask)

SELECT examples

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

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;