Class: Google::Apis::HealthV4::Food

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_levelString

Required. The access level of the food. Corresponds to the JSON property accessLevel

Returns:

  • (String)


2388
2389
2390
# File 'lib/google/apis/health_v4/classes.rb', line 2388

def access_level
  @access_level
end

#brandString

Optional. The brand of the food. Corresponds to the JSON property brand

Returns:

  • (String)


2393
2394
2395
# File 'lib/google/apis/health_v4/classes.rb', line 2393

def brand
  @brand
end

#default_servingGoogle::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

#descriptionString

Optional. The description of the food. Corresponds to the JSON property description

Returns:

  • (String)


2404
2405
2406
# File 'lib/google/apis/health_v4/classes.rb', line 2404

def description
  @description
end

#display_nameString

Required. The display name of the food. Corresponds to the JSON property displayName

Returns:

  • (String)


2409
2410
2411
# File 'lib/google/apis/health_v4/classes.rb', line 2409

def display_name
  @display_name
end

#energy_avgGoogle::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_fatGoogle::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_maxGoogle::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_minGoogle::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_codeString

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

Returns:

  • (String)


2435
2436
2437
# File 'lib/google/apis/health_v4/classes.rb', line 2435

def language_code
  @language_code
end

#meal_typeString

Optional. The meal type associated with this food. Corresponds to the JSON property mealType

Returns:

  • (String)


2440
2441
2442
# File 'lib/google/apis/health_v4/classes.rb', line 2440

def meal_type
  @meal_type
end

#nutrientsArray<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

#servingsArray<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_carbohydrateGoogle::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_fatGoogle::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