Class: Google::Apis::HealthV4::Food
- Inherits:
-
Object
- Object
- Google::Apis::HealthV4::Food
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/health_v4/classes.rb,
lib/google/apis/health_v4/representations.rb,
lib/google/apis/health_v4/representations.rb
Overview
Represents a food item.
Instance Attribute Summary collapse
-
#access_level ⇒ String
Required.
-
#brand ⇒ String
Optional.
-
#default_serving ⇒ Google::Apis::HealthV4::FoodServing
Represents different properties and information about the serving of a specific food.
-
#description ⇒ String
Optional.
-
#display_name ⇒ String
Required.
-
#energy_avg ⇒ Google::Apis::HealthV4::EnergyQuantity
Represents the energy quantity.
-
#energy_from_fat ⇒ Google::Apis::HealthV4::EnergyQuantity
Represents the energy quantity.
-
#energy_max ⇒ Google::Apis::HealthV4::EnergyQuantity
Represents the energy quantity.
-
#energy_min ⇒ Google::Apis::HealthV4::EnergyQuantity
Represents the energy quantity.
-
#language_code ⇒ String
Optional.
-
#meal_type ⇒ String
Optional.
-
#nutrients ⇒ Array<Google::Apis::HealthV4::NutrientQuantity>
Optional.
-
#servings ⇒ Array<Google::Apis::HealthV4::FoodServing>
Optional.
-
#total_carbohydrate ⇒ Google::Apis::HealthV4::WeightQuantity
Represents the weight quantity.
-
#total_fat ⇒ Google::Apis::HealthV4::WeightQuantity
Represents the weight quantity.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Food
constructor
A new instance of Food.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Food
Returns a new instance of Food.
2462 2463 2464 |
# File 'lib/google/apis/health_v4/classes.rb', line 2462 def initialize(**args) update!(**args) end |
Instance Attribute Details
#access_level ⇒ String
Required. The access level of the food.
Corresponds to the JSON property accessLevel
2388 2389 2390 |
# File 'lib/google/apis/health_v4/classes.rb', line 2388 def access_level @access_level end |
#brand ⇒ String
Optional. The brand of the food.
Corresponds to the JSON property brand
2393 2394 2395 |
# File 'lib/google/apis/health_v4/classes.rb', line 2393 def brand @brand end |
#default_serving ⇒ Google::Apis::HealthV4::FoodServing
Represents different properties and information about the serving of a
specific food.
Corresponds to the JSON property defaultServing
2399 2400 2401 |
# File 'lib/google/apis/health_v4/classes.rb', line 2399 def default_serving @default_serving end |
#description ⇒ String
Optional. The description of the food.
Corresponds to the JSON property description
2404 2405 2406 |
# File 'lib/google/apis/health_v4/classes.rb', line 2404 def description @description end |
#display_name ⇒ String
Required. The display name of the food.
Corresponds to the JSON property displayName
2409 2410 2411 |
# File 'lib/google/apis/health_v4/classes.rb', line 2409 def display_name @display_name end |
#energy_avg ⇒ Google::Apis::HealthV4::EnergyQuantity
Represents the energy quantity.
Corresponds to the JSON property energyAvg
2414 2415 2416 |
# File 'lib/google/apis/health_v4/classes.rb', line 2414 def energy_avg @energy_avg end |
#energy_from_fat ⇒ Google::Apis::HealthV4::EnergyQuantity
Represents the energy quantity.
Corresponds to the JSON property energyFromFat
2419 2420 2421 |
# File 'lib/google/apis/health_v4/classes.rb', line 2419 def energy_from_fat @energy_from_fat end |
#energy_max ⇒ Google::Apis::HealthV4::EnergyQuantity
Represents the energy quantity.
Corresponds to the JSON property energyMax
2424 2425 2426 |
# File 'lib/google/apis/health_v4/classes.rb', line 2424 def energy_max @energy_max end |
#energy_min ⇒ Google::Apis::HealthV4::EnergyQuantity
Represents the energy quantity.
Corresponds to the JSON property energyMin
2429 2430 2431 |
# File 'lib/google/apis/health_v4/classes.rb', line 2429 def energy_min @energy_min end |
#language_code ⇒ String
Optional. The language code where the food is available in format xx-XX.
Supported values are defined in Settings.food_language_code.
Corresponds to the JSON property languageCode
2435 2436 2437 |
# File 'lib/google/apis/health_v4/classes.rb', line 2435 def language_code @language_code end |
#meal_type ⇒ String
Optional. The meal type associated with this food.
Corresponds to the JSON property mealType
2440 2441 2442 |
# File 'lib/google/apis/health_v4/classes.rb', line 2440 def meal_type @meal_type end |
#nutrients ⇒ Array<Google::Apis::HealthV4::NutrientQuantity>
Optional. Value representing the nutrients of the food for the default serving.
Corresponds to the JSON property nutrients
2445 2446 2447 |
# File 'lib/google/apis/health_v4/classes.rb', line 2445 def nutrients @nutrients end |
#servings ⇒ Array<Google::Apis::HealthV4::FoodServing>
Optional. The serving of the food.
Corresponds to the JSON property servings
2450 2451 2452 |
# File 'lib/google/apis/health_v4/classes.rb', line 2450 def servings @servings end |
#total_carbohydrate ⇒ Google::Apis::HealthV4::WeightQuantity
Represents the weight quantity.
Corresponds to the JSON property totalCarbohydrate
2455 2456 2457 |
# File 'lib/google/apis/health_v4/classes.rb', line 2455 def total_carbohydrate @total_carbohydrate end |
#total_fat ⇒ Google::Apis::HealthV4::WeightQuantity
Represents the weight quantity.
Corresponds to the JSON property totalFat
2460 2461 2462 |
# File 'lib/google/apis/health_v4/classes.rb', line 2460 def total_fat @total_fat end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 |
# File 'lib/google/apis/health_v4/classes.rb', line 2467 def update!(**args) @access_level = args[:access_level] if args.key?(:access_level) @brand = args[:brand] if args.key?(:brand) @default_serving = args[:default_serving] if args.key?(:default_serving) @description = args[:description] if args.key?(:description) @display_name = args[:display_name] if args.key?(:display_name) @energy_avg = args[:energy_avg] if args.key?(:energy_avg) @energy_from_fat = args[:energy_from_fat] if args.key?(:energy_from_fat) @energy_max = args[:energy_max] if args.key?(:energy_max) @energy_min = args[:energy_min] if args.key?(:energy_min) @language_code = args[:language_code] if args.key?(:language_code) @meal_type = args[:meal_type] if args.key?(:meal_type) @nutrients = args[:nutrients] if args.key?(:nutrients) @servings = args[:servings] if args.key?(:servings) @total_carbohydrate = args[:total_carbohydrate] if args.key?(:total_carbohydrate) @total_fat = args[:total_fat] if args.key?(:total_fat) end |