feat: add menstrual cycle, symptoms, and mood data types to Health API v4

feat: expand ExerciseType enum with comprehensive activity categories
feat: add granular OAuth scopes and per-method authorization mappings
fix!: An existing packaging option `google.golang.org/genproto/googleapis/devicesandservices/health/apiv4main;healthpb` for `go_package` is removed
fix!: A new packaging option `google.golang.org/genproto/googleapis/devicesandservices/health/apiv4;healthpb` for `go_package` is added
docs: improve documentation for data_source_family and window_size parameters

This update introduces several capabilities and refinements to Google Devices and Services Health API v4:

1. New Data Models & DataPoint Fields:
   - Added support for menstrual cycle tracking (`MenstrualPeriod`, `OvulationTest` with `OvulationTestResult` enum).
   - Added symptom tracking (`Symptoms` with `SymptomValue` enum).
   - Added emotional wellbeing tracking (`Moods` with `Mood` and `Valence` enums).
   - Expanded `ExerciseType` enum with additional activity classifications.

2. Authorization & Scopes:
   - Introduced granular OAuth scopes (such as `logged_symptoms`, `mindfulness`, `reproductive_health`, `nutrition`, `profile.writeonly`, and `settings.writeonly`).
   - Configured explicit per-RPC canonical scopes for all `DataPointsService` and `HealthProfileService` methods.

3. Documentation Improvements:
   - Clarified behavior and definitions for `data_source_family` filter values (`all-sources`, `google-wearables`, `google-sources`).
   - Clarified constraints on aggregation `window_size` (minimum 1 second).

PiperOrigin-RevId: 964677373
This commit is contained in:
Google APIs 2026-08-14 06:57:47 -07:00 committed by Copybara-Service
parent 37c83e244b
commit ea280c4eb7
10 changed files with 1183 additions and 91 deletions

View file

@ -139,7 +139,7 @@ load(
go_grpc_library(
name = "health_go_proto",
importpath = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4main",
importpath = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4",
protos = [":health_proto"],
deps = [
"//google/api:annotations_go_proto",
@ -353,6 +353,7 @@ load(
csharp_proto_library(
name = "health_csharp_proto",
extra_opts = [],
deps = [":health_proto"],
)

View file

@ -23,7 +23,7 @@ import "google/type/date.proto";
import "google/type/timeofday.proto";
option csharp_namespace = "Google.DevicesAndServices.Health.V4";
option go_package = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4main;healthpb";
option go_package = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4;healthpb";
option java_multiple_files = true;
option java_outer_classname = "DataCoordinatesProto";
option java_package = "com.google.devicesandservices.health.v4";

File diff suppressed because it is too large Load diff

View file

@ -30,7 +30,7 @@ import "google/rpc/status.proto";
import "google/type/interval.proto";
option csharp_namespace = "Google.DevicesAndServices.Health.V4";
option go_package = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4main;healthpb";
option go_package = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4;healthpb";
option java_multiple_files = true;
option java_outer_classname = "DataPointsProto";
option java_package = "com.google.devicesandservices.health.v4";
@ -43,9 +43,19 @@ service DataPointsService {
option (google.api.default_host) = "health.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly,"
"https://www.googleapis.com/auth/googlehealth.activity_and_fitness.writeonly,"
"https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.readonly,"
"https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.writeonly,"
"https://www.googleapis.com/auth/googlehealth.location.readonly,"
"https://www.googleapis.com/auth/googlehealth.sleep.readonly";
"https://www.googleapis.com/auth/googlehealth.logged_symptoms.readonly,"
"https://www.googleapis.com/auth/googlehealth.logged_symptoms.writeonly,"
"https://www.googleapis.com/auth/googlehealth.mindfulness.readonly,"
"https://www.googleapis.com/auth/googlehealth.mindfulness.writeonly,"
"https://www.googleapis.com/auth/googlehealth.nutrition.writeonly,"
"https://www.googleapis.com/auth/googlehealth.reproductive_health.readonly,"
"https://www.googleapis.com/auth/googlehealth.reproductive_health.writeonly,"
"https://www.googleapis.com/auth/googlehealth.sleep.readonly,"
"https://www.googleapis.com/auth/googlehealth.sleep.writeonly";
// Get a single identifyable data point.
rpc GetDataPoint(GetDataPointRequest) returns (DataPoint) {
@ -335,6 +345,22 @@ message DataPoint {
// Optional. Data for points in the `blood-glucose` sample data type
// collection.
BloodGlucose blood_glucose = 46 [(google.api.field_behavior) = OPTIONAL];
// Optional. Data for points in the `menstrual-period` interval data type
// collection.
MenstrualPeriod menstrual_period = 49
[(google.api.field_behavior) = OPTIONAL];
// Optional. Data for points in the `ovulation-test` sample data type
// collection.
OvulationTest ovulation_test = 50 [(google.api.field_behavior) = OPTIONAL];
// Optional. Data for points in the `symptoms` sample data type
// collection.
Symptoms symptoms = 52 [(google.api.field_behavior) = OPTIONAL];
// Optional. Data for points in the `moods` sample data type collection.
Moods moods = 53 [(google.api.field_behavior) = OPTIONAL];
}
// Identifier. Data point name, only supported for the subset of identifiable
@ -352,7 +378,7 @@ message DataPoint {
// The `{data_type}` ID corresponds to the kebab-case version of the field
// names in the [DataPoint
// data][google.devicesandservices.health.v4.DataPoint] union
// field, e.g. `total-calories` for the `total_calories` field.
// field, e.g. `heart-rate` for the `heart_rate` field.
//
// The `{data_point}` ID can be client-provided or system-generated.
// If client-provided, it must be a string of 4-63 characters,
@ -505,7 +531,7 @@ message ReconciledDataPoint {
// The `{data_type}` ID corresponds to the kebab-case version of the field
// names in the [DataPoint
// data][google.devicesandservices.health.v4.DataPoint] union
// field, e.g. `total-calories` for the `total_calories` field.
// field, e.g. `heart-rate` for the `heart_rate` field.
//
// The `{data_point}` ID can be client-provided or system-generated.
// If client-provided, it must be a string of 4-63 characters,
@ -1073,12 +1099,14 @@ message ReconcileDataPointsRequest {
//
// Format: `users/me/dataSourceFamilies/{data_source_family}`
//
// The supported values are:
//
// - `users/me/dataSourceFamilies/all-sources` - default value
// - `users/me/dataSourceFamilies/google-wearables` - tracker devices
// - `users/me/dataSourceFamilies/google-sources` - Google first party
// sources
// - `users/me/dataSourceFamilies/all-sources` - Default value. Includes data
// from all available data sources.
// - `users/me/dataSourceFamilies/google-wearables` - Includes data from
// Google and Fitbit tracker devices (such as Fitbit trackers and Pixel
// Watch). Excludes manually logged data.
// - `users/me/dataSourceFamilies/google-sources` - Includes first-party
// Google data, such as data from tracker devices, manually logged data, and
// Health Connect.
string data_source_family = 5 [(google.api.field_behavior) = OPTIONAL];
}
@ -1115,7 +1143,7 @@ message RollUpDataPointsRequest {
google.type.Interval range = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The size of the time window to group data points into before
// applying the aggregation functions.
// applying the aggregation functions. Must be at least 1 second.
google.protobuf.Duration window_size = 3
[(google.api.field_behavior) = REQUIRED];
@ -1138,10 +1166,14 @@ message RollUpDataPointsRequest {
//
// The supported values are:
//
// - `users/me/dataSourceFamilies/all-sources` - default value
// - `users/me/dataSourceFamilies/google-wearables` - tracker devices
// - `users/me/dataSourceFamilies/google-sources` - Google first party
// sources
// - `users/me/dataSourceFamilies/all-sources` - Default value. Includes data
// from all available data sources.
// - `users/me/dataSourceFamilies/google-wearables` - Includes data from
// Google and Fitbit tracker devices (such as Fitbit trackers and Pixel
// Watch). Excludes manually logged data.
// - `users/me/dataSourceFamilies/google-sources` - Includes first-party
// Google data, such as data from tracker devices, manually logged data, and
// Health Connect.
string data_source_family = 7 [(google.api.field_behavior) = OPTIONAL];
}
@ -1201,10 +1233,14 @@ message DailyRollUpDataPointsRequest {
//
// The supported values are:
//
// - `users/me/dataSourceFamilies/all-sources` - default value
// - `users/me/dataSourceFamilies/google-wearables` - tracker devices
// - `users/me/dataSourceFamilies/google-sources` - Google first party
// sources
// - `users/me/dataSourceFamilies/all-sources` - Default value. Includes data
// from all available data sources.
// - `users/me/dataSourceFamilies/google-wearables` - Includes data from
// Google and Fitbit tracker devices (such as Fitbit trackers and Pixel
// Watch). Excludes manually logged data.
// - `users/me/dataSourceFamilies/google-sources` - Includes first-party
// Google data, such as data from tracker devices, manually logged data, and
// Health Connect.
string data_source_family = 7 [(google.api.field_behavior) = OPTIONAL];
}

View file

@ -19,7 +19,7 @@ package google.devicesandservices.health.v4;
import "google/api/field_behavior.proto";
option csharp_namespace = "Google.DevicesAndServices.Health.V4";
option go_package = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4main;healthpb";
option go_package = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4;healthpb";
option java_multiple_files = true;
option java_outer_classname = "DataSourceProto";
option java_package = "com.google.devicesandservices.health.v4";

View file

@ -26,7 +26,7 @@ import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.DevicesAndServices.Health.V4";
option go_package = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4main;healthpb";
option go_package = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4;healthpb";
option java_multiple_files = true;
option java_outer_classname = "DataSubscriptionServiceProto";
option java_package = "com.google.devicesandservices.health.v4";
@ -181,8 +181,8 @@ service DataSubscriptionService {
// Request message for CreateSubscriber.
message CreateSubscriberRequest {
// Required. The parent resource where this subscriber will be created.
// Format: projects/{project}
// Example: projects/my-project-123
// Format: projects/{project_number}
// Example: projects/1234567890
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
@ -325,7 +325,7 @@ message ListSubscriptionsRequest {
// - `data_type`
//
// The `user` identifier (e.g., `user1` in `users/user1`) refers to the public
// `healthUserId`
// `health_user_id`
//
// Example: user = "users/user1"
// Example: user = "users/user1" OR user = "users/user2"
@ -484,8 +484,9 @@ message Subscription {
// A subscriber will only receive notifications for data types that are
// declared here.
// A subscription can only subscribe to the data types of the subscriber.
// Supported data types are: "altitude", "distance", "floors", "sleep",
// "steps", "weight".
// The values should be in the format
// "users/{health_user_id}/dataTypes/{data_type}" where `{data_type}` is one
// of "altitude", "distance", "floors", "sleep", "steps", "weight".
repeated string data_types = 2 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = { type: "health.googleapis.com/DataType" }

View file

@ -26,7 +26,7 @@ import "google/protobuf/timestamp.proto";
import "google/type/date.proto";
option csharp_namespace = "Google.DevicesAndServices.Health.V4";
option go_package = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4main;healthpb";
option go_package = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4;healthpb";
option java_multiple_files = true;
option java_outer_classname = "HealthProfileProto";
option java_package = "com.google.devicesandservices.health.v4";
@ -41,8 +41,13 @@ service HealthProfileService {
"https://www.googleapis.com/auth/googlehealth.ecg.readonly,"
"https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.readonly,"
"https://www.googleapis.com/auth/googlehealth.irn.readonly,"
"https://www.googleapis.com/auth/googlehealth.logged_symptoms.readonly,"
"https://www.googleapis.com/auth/googlehealth.mindfulness.readonly,"
"https://www.googleapis.com/auth/googlehealth.profile.readonly,"
"https://www.googleapis.com/auth/googlehealth.profile.writeonly,"
"https://www.googleapis.com/auth/googlehealth.reproductive_health.readonly,"
"https://www.googleapis.com/auth/googlehealth.settings.readonly,"
"https://www.googleapis.com/auth/googlehealth.settings.writeonly,"
"https://www.googleapis.com/auth/googlehealth.sleep.readonly";
// Returns user Profile details.
@ -556,8 +561,6 @@ message Settings {
bool auto_stride_enabled = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. The measurement unit defined in the user's account settings.
//
// Updates to this field are currently not supported.
DistanceUnit distance_unit = 5 [(google.api.field_behavior) = OPTIONAL];
// Optional. The measurement unit defined in the user's account settings.

View file

@ -24,22 +24,68 @@ authentication:
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly,
https://www.googleapis.com/auth/googlehealth.activity_and_fitness.writeonly,
https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.readonly,
https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.writeonly,
https://www.googleapis.com/auth/googlehealth.location.readonly,
https://www.googleapis.com/auth/googlehealth.sleep.readonly
https://www.googleapis.com/auth/googlehealth.logged_symptoms.readonly,
https://www.googleapis.com/auth/googlehealth.logged_symptoms.writeonly,
https://www.googleapis.com/auth/googlehealth.mindfulness.readonly,
https://www.googleapis.com/auth/googlehealth.mindfulness.writeonly,
https://www.googleapis.com/auth/googlehealth.nutrition.writeonly,
https://www.googleapis.com/auth/googlehealth.reproductive_health.readonly,
https://www.googleapis.com/auth/googlehealth.reproductive_health.writeonly,
https://www.googleapis.com/auth/googlehealth.sleep.readonly,
https://www.googleapis.com/auth/googlehealth.sleep.writeonly
- selector: google.devicesandservices.health.v4.DataPointsService.BatchDeleteDataPoints
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/googlehealth.activity_and_fitness.writeonly,
https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.writeonly,
https://www.googleapis.com/auth/googlehealth.logged_symptoms.writeonly,
https://www.googleapis.com/auth/googlehealth.mindfulness.writeonly,
https://www.googleapis.com/auth/googlehealth.nutrition.writeonly,
https://www.googleapis.com/auth/googlehealth.reproductive_health.writeonly,
https://www.googleapis.com/auth/googlehealth.sleep.writeonly
- selector: google.devicesandservices.health.v4.DataPointsService.CreateDataPoint
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/googlehealth.activity_and_fitness.writeonly,
https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.writeonly,
https://www.googleapis.com/auth/googlehealth.logged_symptoms.writeonly,
https://www.googleapis.com/auth/googlehealth.mindfulness.writeonly,
https://www.googleapis.com/auth/googlehealth.nutrition.writeonly,
https://www.googleapis.com/auth/googlehealth.reproductive_health.writeonly,
https://www.googleapis.com/auth/googlehealth.sleep.writeonly
- selector: google.devicesandservices.health.v4.DataPointsService.ExportExerciseTcx
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly,
https://www.googleapis.com/auth/googlehealth.location.readonly
- selector: google.devicesandservices.health.v4.DataPointsService.GetDataPoint
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly,
https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.readonly,
https://www.googleapis.com/auth/googlehealth.location.readonly,
https://www.googleapis.com/auth/googlehealth.logged_symptoms.readonly,
https://www.googleapis.com/auth/googlehealth.mindfulness.readonly,
https://www.googleapis.com/auth/googlehealth.reproductive_health.readonly,
https://www.googleapis.com/auth/googlehealth.sleep.readonly
- selector: google.devicesandservices.health.v4.DataPointsService.UpdateDataPoint
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/googlehealth.activity_and_fitness.writeonly,
https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.writeonly,
https://www.googleapis.com/auth/googlehealth.logged_symptoms.writeonly,
https://www.googleapis.com/auth/googlehealth.mindfulness.writeonly,
https://www.googleapis.com/auth/googlehealth.nutrition.writeonly,
https://www.googleapis.com/auth/googlehealth.reproductive_health.writeonly,
https://www.googleapis.com/auth/googlehealth.sleep.writeonly
- selector: 'google.devicesandservices.health.v4.DataSubscriptionService.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.devicesandservices.health.v4.HealthProfileService.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/googlehealth.settings.readonly
- selector: google.devicesandservices.health.v4.HealthProfileService.GetIdentity
oauth:
canonical_scopes: |-
@ -47,17 +93,40 @@ authentication:
https://www.googleapis.com/auth/googlehealth.ecg.readonly,
https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.readonly,
https://www.googleapis.com/auth/googlehealth.irn.readonly,
https://www.googleapis.com/auth/googlehealth.logged_symptoms.readonly,
https://www.googleapis.com/auth/googlehealth.mindfulness.readonly,
https://www.googleapis.com/auth/googlehealth.profile.readonly,
https://www.googleapis.com/auth/googlehealth.reproductive_health.readonly,
https://www.googleapis.com/auth/googlehealth.settings.readonly,
https://www.googleapis.com/auth/googlehealth.sleep.readonly
- selector: google.devicesandservices.health.v4.HealthProfileService.GetIrnProfile
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/googlehealth.irn.readonly
- selector: google.devicesandservices.health.v4.HealthProfileService.GetPairedDevice
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/googlehealth.settings.readonly
- selector: google.devicesandservices.health.v4.HealthProfileService.GetProfile
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/googlehealth.profile.readonly
- selector: google.devicesandservices.health.v4.HealthProfileService.GetSettings
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/googlehealth.settings.readonly
- selector: google.devicesandservices.health.v4.HealthProfileService.ListPairedDevices
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/googlehealth.settings.readonly
- selector: google.devicesandservices.health.v4.HealthProfileService.UpdateProfile
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/googlehealth.profile.writeonly
- selector: google.devicesandservices.health.v4.HealthProfileService.UpdateSettings
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/googlehealth.settings.writeonly
publishing:
new_issue_uri: https://issuetracker.google.com/issues/new?component=1914241
@ -65,7 +134,7 @@ publishing:
api_short_name: health
github_label: 'api: health'
doc_tag_prefix: health
organization: CLOUD
organization: HEALTH
library_settings:
- version: google.devicesandservices.health.v4
launch_stage: GA

View file

@ -19,7 +19,7 @@ package google.devicesandservices.health.v4;
import "google/api/field_behavior.proto";
option csharp_namespace = "Google.DevicesAndServices.Health.V4";
option go_package = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4main;healthpb";
option go_package = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4;healthpb";
option java_multiple_files = true;
option java_outer_classname = "MedicalDeviceInfoProto";
option java_package = "com.google.devicesandservices.health.v4";

View file

@ -20,7 +20,7 @@ import "google/api/field_behavior.proto";
import "google/rpc/http.proto";
option csharp_namespace = "Google.DevicesAndServices.Health.V4";
option go_package = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4main;healthpb";
option go_package = "google.golang.org/genproto/googleapis/devicesandservices/health/apiv4;healthpb";
option java_multiple_files = true;
option java_outer_classname = "WebhookNotificationCloudLogProto";
option java_package = "com.google.devicesandservices.health.v4";