Class NutritionLog
Holds information about a user logged food.
There are two ways of creating a nutrition log based on the food type:
- Identified food: Using the food field, which is a reference to a Food
resource. In this case fields
nutrients,energy,energy_from_fat,total_carbohydrate,total_fat,food_display_namewill be populated based on the referenced food. - Anonymous food: Using the
food_display_namefield and setting thenutrients,energy,energy_from_fat,total_carbohydrate,total_fatfields manually.
The identified food is preferred over the anonymous food. Nutrition logs created from anonymous food are not be editable.
Implements
Namespace: Google.DevicesAndServices.Health.V4
Assembly: Google.DevicesAndServices.Health.V4.dll
Syntax
public sealed class NutritionLog : IMessage<NutritionLog>, IEquatable<NutritionLog>, IDeepCloneable<NutritionLog>, IBufferMessage, IMessage
Constructors
NutritionLog()
Declaration
public NutritionLog()
NutritionLog(NutritionLog)
Declaration
public NutritionLog(NutritionLog other)
Parameters
| Type | Name | Description |
|---|---|---|
| NutritionLog | other |
Properties
Energy
Optional. Value representing the energy of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
Declaration
public EnergyQuantity Energy { get; set; }
Property Value
| Type | Description |
|---|---|
| EnergyQuantity |
EnergyFromFat
Optional. Value representing the energy from fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
Declaration
public EnergyQuantity EnergyFromFat { get; set; }
Property Value
| Type | Description |
|---|---|
| EnergyQuantity |
Food
Required. Represents the food ID.
Declaration
public string Food { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
FoodAsDataPointName
DataPointName-typed view over the Food resource name property.
Declaration
public DataPointName FoodAsDataPointName { get; set; }
Property Value
| Type | Description |
|---|---|
| DataPointName |
FoodDisplayName
Value representing the display name of the food. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
Declaration
public string FoodDisplayName { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Interval
Required. Observed interval.
Declaration
public SessionTimeInterval Interval { get; set; }
Property Value
| Type | Description |
|---|---|
| SessionTimeInterval |
MealType
Optional. Value representing the meal type of the nutrition log.
Declaration
public MealType MealType { get; set; }
Property Value
| Type | Description |
|---|---|
| MealType |
Nutrients
Optional. Value representing the nutrients of the nutrition log.
Declaration
public RepeatedField<NutrientQuantity> Nutrients { get; }
Property Value
| Type | Description |
|---|---|
| RepeatedField<NutrientQuantity> |
Serving
Optional. Value representing the nutrition log serving.
Declaration
public NutritionLog.Types.Serving Serving { get; set; }
Property Value
| Type | Description |
|---|---|
| NutritionLog.Types.Serving |
TotalCarbohydrate
Optional. Value representing the total carbohydrate of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
Declaration
public WeightQuantity TotalCarbohydrate { get; set; }
Property Value
| Type | Description |
|---|---|
| WeightQuantity |
TotalFat
Optional. Value representing the total fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
Declaration
public WeightQuantity TotalFat { get; set; }
Property Value
| Type | Description |
|---|---|
| WeightQuantity |