// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.devicesandservices.health.v4;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/field_mask.proto";
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 java_multiple_files = true;
option java_outer_classname = "HealthProfileProto";
option java_package = "com.google.devicesandservices.health.v4";
option php_namespace = "Google\\DevicesAndServices\\Health\\V4";
option ruby_package = "Google::DevicesAndServices::Health::V4";

// Health Profile Service
service HealthProfileService {
  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.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.profile.readonly,"
      "https://www.googleapis.com/auth/googlehealth.settings.readonly,"
      "https://www.googleapis.com/auth/googlehealth.sleep.readonly";

  // Returns user Profile details.
  rpc GetProfile(GetProfileRequest) returns (Profile) {
    option (google.api.http) = {
      get: "/v4/{name=users/*/profile}"
    };
    option (google.api.method_signature) = "name";
  }

  // Updates the user's profile details.
  rpc UpdateProfile(UpdateProfileRequest) returns (Profile) {
    option (google.api.http) = {
      patch: "/v4/{profile.name=users/*/profile}"
      body: "profile"
    };
    option (google.api.method_signature) = "profile,update_mask";
  }

  // Returns user settings details.
  rpc GetSettings(GetSettingsRequest) returns (Settings) {
    option (google.api.http) = {
      get: "/v4/{name=users/*/settings}"
    };
    option (google.api.method_signature) = "name";
  }

  // Updates the user's settings details.
  rpc UpdateSettings(UpdateSettingsRequest) returns (Settings) {
    option (google.api.http) = {
      patch: "/v4/{settings.name=users/*/settings}"
      body: "settings"
    };
    option (google.api.method_signature) = "settings,update_mask";
  }

  // Gets the user's identity.
  //
  // It includes the legacy Fitbit user ID and the Google user ID and it can be
  // used by migrating clients to map identifiers between the two systems.
  rpc GetIdentity(GetIdentityRequest) returns (Identity) {
    option (google.api.http) = {
      get: "/v4/{name=users/*/identity}"
    };
    option (google.api.method_signature) = "name";
  }

  // Returns user's IRN Profile details.
  rpc GetIrnProfile(GetIrnProfileRequest) returns (IrnProfile) {
    option (google.api.http) = {
      get: "/v4/{name=users/*/irnProfile}"
    };
    option (google.api.method_signature) = "name";
  }

  // Returns user's Device.
  rpc GetPairedDevice(GetPairedDeviceRequest) returns (PairedDevice) {
    option (google.api.http) = {
      get: "/v4/{name=users/*/pairedDevices/*}"
    };
    option (google.api.method_signature) = "name";
  }

  // Returns the user's list of paired 1P trackers and smartwatches.
  rpc ListPairedDevices(ListPairedDevicesRequest)
      returns (ListPairedDevicesResponse) {
    option (google.api.http) = {
      get: "/v4/{parent=users/*}/pairedDevices"
    };
    option (google.api.method_signature) = "parent";
  }
}

// Represents a user in the Google Health API.
// It matches the parent resource of collections owned by the user.
//
// Clients currently do not need to interact with this resource directly.
message User {
  option (google.api.resource) = {
    type: "health.googleapis.com/User"
    pattern: "users/{user}"
    plural: "users"
    singular: "user"
  };

  // Identifier. The resource name of the user.
  //
  // The `{user}` ID is a system-generated identifier, as described in
  // [Identity.health_user_id][google.devicesandservices.health.v4.Identity.health_user_id].
  //
  // Format: `users/{user}`
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];
}

// Profile details.
message Profile {
  option (google.api.resource) = {
    type: "health.googleapis.com/Profile"
    pattern: "users/{user}/profile"
    plural: "profiles"
    singular: "profile"
  };

  // Identifier. The resource name of this Profile resource.
  //
  // Format: `users/{user}/profile`
  // Example: `users/1234567890/profile` or `users/me/profile`
  // 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.
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Optional. The age in years based on the user's birth date.
  //
  // Updates to this field are currently not supported.
  int32 age = 6 [(google.api.field_behavior) = OPTIONAL];

  // Output only. The date the user created their account.
  //
  // Updates to this field are currently not supported.
  google.type.Date membership_start_date = 9
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. The user's user configured walking stride length, in millimeters.
  //
  // The user must consent to
  // one of the following access scopes to access this field:
  //
  // -
  // `https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly`
  // - `https://www.googleapis.com/auth/googlehealth.activity_and_fitness`
  optional int32 user_configured_walking_stride_length_mm = 13
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The user's user configured running stride length, in millimeters.
  //
  // The user must consent to
  // one of the following access scopes to access this field:
  //
  // -
  // `https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly`
  // - `https://www.googleapis.com/auth/googlehealth.activity_and_fitness`
  optional int32 user_configured_running_stride_length_mm = 14
      [(google.api.field_behavior) = OPTIONAL];

  // Output only. The automatically calculated walking stride length, in
  // millimeters.
  //
  // The user must consent to
  // one of the following access scopes to access this field:
  //
  // -
  // `https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly`
  // - `https://www.googleapis.com/auth/googlehealth.activity_and_fitness`
  optional int32 auto_walking_stride_length_mm = 15
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The automatically calculated running stride length, in
  // millimeters.
  //
  // The user must consent to
  // one of the following access scopes to access this field:
  //
  // -
  // `https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly`
  // - `https://www.googleapis.com/auth/googlehealth.activity_and_fitness`
  optional int32 auto_running_stride_length_mm = 16
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// User's Paired 1P Device
//
// The PairedDevice details include information about the device type, battery
// status, battery level, last sync time, device version, mac address, and
// features.
message PairedDevice {
  option (google.api.resource) = {
    type: "health.googleapis.com/PairedDevice"
    pattern: "users/{user}/pairedDevices/{paired_device}"
    plural: "pairedDevices"
    singular: "pairedDevice"
  };

  // The type of device.
  enum DeviceType {
    // Device type is not specified.
    DEVICE_TYPE_UNSPECIFIED = 0;

    // Device type is tracker.
    TRACKER = 1;

    // Device type is scale.
    SCALE = 2;
  }

  // Identifier. The resource name of this Device resource.
  //
  // Format: `users/{user}/pairedDevices/{paired_device}`
  // Example: `users/1234567890/pairedDevices/123` or
  // `users/me/pairedDevices/123`
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Output only. The device type.
  // Supported: TRACKER | SCALE
  DeviceType device_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The battery status of the device.
  // Supported: High | Medium | Low | Empty
  string battery_status = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The battery level of the device.
  int32 battery_level = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time of last sync with the Fitbit mobile application.
  google.protobuf.Timestamp last_sync_time = 6
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The product name of the device
  string device_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Mac ID number of the device.
  string mac_address = 8 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Lists of unique features supported by the device.
  //
  // Comprehensive list of supported features:
  //
  // **Fitness Tracking**
  //
  // - `ACTIVE_MINUTES`: Legacy active minutes.
  // - `AUTOSTRIDE`: Automatic stride length calculation.
  // - `BIKE_ONBOARDING`: Cycling UI support.
  // - `CALORIES`: Daily burned calories.
  // - `DISTANCE`: Daily distance tracking.
  // - `ELEVATION`: Floors climbed.
  // - `INACTIVITY_ALERTS`: Reminders to move.
  // - `SEDENTARY_TIME`: Tracks inactive time.
  // - `STEPS`: Daily steps.
  // - `SWIM`: Swim tracking (laps/strokes).
  // - `AUTORUN`: Automatic run detection.
  // - `ACTIVE_ZONE_MINUTES`: Active Zone Minutes (AZM).
  //
  // **Heart Rate & Health**
  //
  // - `HEART_RATE`: Continuous heart rate (PPG).
  // - `BAT_SIGNAL`: High/Low Heart Rate Alerts.
  //
  // **Advanced Sensors**
  //
  // - `SPO2`: Blood oxygen saturation.
  // - `NIGHTTIME_OXYGEN_SATURATION`: Sleep SpO2.
  // - `ESTIMATED_OXYGEN_VARIATION`: Estimated Oxygen Variation.
  // - `EDA`: Electrodermal Activity (stress).
  // - `SKIN_TEMPERATURE`: Skin temperature variation.
  // - `INTERNAL_DEVICE_TEMPERATURE`: Internal device temperature.
  //
  // **Sleep & Wellness**
  //
  // - `SLEEP`: Basic sleep tracking.
  // - `SMART_SLEEP`: Advanced sleep tracking (stages/score).
  // - `BEDTIME_REMINDER`: Bedtime reminders.
  // - `SOUNDSCAPE`: Snore and noise detection.
  //
  // **Advanced Workouts**
  //
  // - `WB`: Custom Workout Builder.
  // - `AUTOCUES`: Auto Cues / Auto Lap.
  // - `DWR_RUN`: Daily Run Recommendations.
  // - `ADVANCED_RUNNING`: Advanced Running Dynamics (e.g., GCT, VO).
  //
  // **GPS & Location**
  //
  // - `GPS`: Built-in GPS.
  // - `CONNECTED_GPS`: Connected GPS (uses phone).
  // - `LOCATION_HINT`: Location helper.
  //
  // **Payments & NFC**
  //
  // - `PAYMENTS`: NFC payments (Fitbit Pay/Google Wallet).
  // - `FELICA`: FeliCa support (Japan payments/transit).
  //
  // **Activity Detection**
  //
  // - `GROK`: SmartTrack automatic activity detection.
  // - `RETRO_AR`: Retroactive Activity Recognition prompts.
  //
  // **Smart Features & UI**
  //
  // - `ALARMS`: Silent alarms.
  // - `BLE_MUSIC_CONTROL`: BLE music control.
  // - `MUSIC`: Direct music storage/control.
  // - `YOUTUBE_MUSIC_SUPPORTED`: YouTube Music support.
  // - `GALLERY`: App Gallery.
  // - `TUTORIAL_SUPPORTED`: On-screen tutorials.
  // - `SMILEY_EMOTE`: Legacy Zip face.
  // - `MOBILE_TO_DEVICE_DEEPLINK`: Mobile to device settings deep link.
  // - `HIDE_GALLERY`: Option to hide Gallery.
  // - `HIDE_GOAL_SELECTION`: Option to hide goal selection.
  // - `DIGITAL_WARRANTY_SUPPORTED`: Digital warranty display.
  // - `DIRECT_DEVICE_SETTINGS_SUPPORTED`: Direct device settings management.
  //
  // **Gym HR Broadcasting**
  //
  // - `ASPEN_SUPPORTED`: Broadcast HR to gym equipment.
  // - `ASPEN_REMOTE_UI_SUPPORTED`: Remote UI for HR sharing.
  //
  // **Privacy & Security**
  //
  // - `FINITE_IMPROBABILITY`: BLE Resolvable Private Address (RPA) privacy.
  // - `DOMAIN_KEY_SYNC`: Domain key synchronization.
  //
  // **BLE Protocol**
  //
  // - `BONDING`: Secure BLE bonding.
  // - `ADVERTISES_SERIAL`: Advertises serial number.
  // - `STATUS_CHARACTERISTIC`: BLE Status Characteristic.
  // - `TRACKER_CHANNEL_CHARACTERISTIC`: BLE Tracker Channel Characteristic.
  // - `PING_CHARACTERISTIC`: BLE Ping Characteristic.
  //
  // **Cellular & Wi-Fi**
  //
  // - `MOBILE_DATA`: LTE cellular support.
  // - `SINGLE_AP_WIFI`: Single AP Wi-Fi.
  // - `MULTI_AP_WIFI`: Multi AP Wi-Fi.
  // - `WIFI_FWUP`: Firmware updates over Wi-Fi.
  //
  // **Data Sync & Transfer**
  //
  // - `APP_SYNC`: Background app sync.
  // - `LIVE_DATA`: Real-time data streaming.
  // - `EVENT_BASED_SYNC_SUPPORTED`: Event-based sync.
  // - `TIME_SERVICE`: Time synchronization service.
  // - `REMOTE_FILE_PROVIDER`: Remote file transfer.
  // - `DIRECT_COMMS_ALARMS`: Direct communication for alarms.
  // - `DIRECT_COMMS_EXERCISE`: Direct communication for exercise.
  // - `DIRECT_COMMS_BATTERY_ALERTS`: Direct communication for battery alerts.
  //
  // **Google Integrations**
  //
  // - `PARROT_TREE_SUPPORTED`: Find My Device support.
  repeated string features = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Irregular Rhythm Notifications (IRN) Profile details.
//
// The Irregular Rhythm Notifications (IRN) feature checks for signs of atrial
// fibrillation (AFib). The IrnProfile details include information about the
// user's onboarding status, enrollment status, and the last update time of
// analyzable data for this feature.
message IrnProfile {
  option (google.api.resource) = {
    type: "health.googleapis.com/IrnProfile"
    pattern: "users/{user}/irnProfile"
    plural: "irnProfiles"
    singular: "irnProfile"
  };

  // Identifier. The resource name of this IrnProfile resource.
  //
  // Format: `users/{user}/irnProfile`
  // Example: `users/1234567890/irnProfile` or `users/me/irnProfile`
  // 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.
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Required. Whether or not the user has onboarded onto the IRN feature.
  bool onboarding_status = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. Whether or not the user is currently enrolled in having their
  // data processed for IRN alerts.
  bool enrollment_status = 3 [(google.api.field_behavior) = REQUIRED];

  // Output only. The timestamp of the last piece of analyzable data synced by
  // the user.
  google.protobuf.Timestamp update_time = 4
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Settings details.
message Settings {
  option (google.api.resource) = {
    type: "health.googleapis.com/Settings"
    pattern: "users/{user}/settings"
    plural: "settings"
    singular: "settings"
  };

  // The measurement unit defined in the user's account settings.
  enum DistanceUnit {
    // Distance unit is not specified.
    DISTANCE_UNIT_UNSPECIFIED = 0;

    // Distance unit is miles.
    DISTANCE_UNIT_MILES = 1;

    // Distance unit is kilometers.
    DISTANCE_UNIT_KILOMETERS = 2;
  }

  // The measurement unit defined in the user's account settings.
  enum GlucoseUnit {
    // Glucose unit is not specified.
    GLUCOSE_UNIT_UNSPECIFIED = 0;

    // Glucose unit is mg/dL.
    GLUCOSE_UNIT_MG_DL = 1;

    // Glucose unit is mmol/l.
    GLUCOSE_UNIT_MMOL_L = 2;
  }

  // The measurement unit defined in the user's account settings.
  enum HeightUnit {
    // Height unit is not specified.
    HEIGHT_UNIT_UNSPECIFIED = 0;

    // Height unit is inches.
    HEIGHT_UNIT_INCHES = 1;

    // Height unit is cm.
    HEIGHT_UNIT_CENTIMETERS = 2;
  }

  // The stride length type defined in the user's account settings. Specifies if
  // the user's stride length is determined automatically (default) or manually
  // as defined in the user's account settings.
  enum StrideLengthType {
    // Stride length type is not specified.
    STRIDE_LENGTH_TYPE_UNSPECIFIED = 0;

    // Stride length type is computed based on the user's gender and height.
    STRIDE_LENGTH_TYPE_DEFAULT = 1;

    // Stride length type is manually set by the user.
    STRIDE_LENGTH_TYPE_MANUAL = 2;

    // Stride length type is determined automatically.
    STRIDE_LENGTH_TYPE_AUTO = 3;
  }

  // The swim unit defined in the user's account settings.
  enum SwimUnit {
    // Swim unit is not specified.
    SWIM_UNIT_UNSPECIFIED = 0;

    // Swim unit is meters.
    SWIM_UNIT_METERS = 1;

    // Swim unit is yards.
    SWIM_UNIT_YARDS = 2;
  }

  // The measurement unit defined in the user's account settings.
  enum TemperatureUnit {
    // Temperature unit is not specified.
    TEMPERATURE_UNIT_UNSPECIFIED = 0;

    // Temperature unit is Celsius.
    TEMPERATURE_UNIT_CELSIUS = 1;

    // Temperature unit is Fahrenheit.
    TEMPERATURE_UNIT_FAHRENHEIT = 2;
  }

  // The measurement unit defined in the user's account settings.
  enum WeightUnit {
    // Weight unit is not specified.
    WEIGHT_UNIT_UNSPECIFIED = 0;

    // Weight unit is pounds.
    WEIGHT_UNIT_POUNDS = 1;

    // Weight unit is stones.
    WEIGHT_UNIT_STONE = 2;

    // Weight unit is kilograms.
    WEIGHT_UNIT_KILOGRAMS = 3;
  }

  // The water measurement unit defined in the user's account settings.
  enum WaterUnit {
    // Water unit is not specified.
    WATER_UNIT_UNSPECIFIED = 0;

    // Water unit is milliliters.
    WATER_UNIT_ML = 1;

    // Water unit is fluid ounces.
    WATER_UNIT_FL_OZ = 2;

    // Water unit is cups.
    WATER_UNIT_CUP = 3;
  }

  // Identifier. 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.
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Optional. True if the user's stride length is determined automatically.
  //
  // Updates to this field are currently not supported.
  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.
  GlucoseUnit glucose_unit = 7 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The measurement unit defined in the user's account settings.
  HeightUnit height_unit = 8 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The locale defined in the user's account settings.
  //
  // Updates to this field are currently not supported.
  string language_locale = 9 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The user's timezone offset relative to UTC.
  //
  // Updates to this field are currently not supported.
  google.protobuf.Duration utc_offset = 10
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The stride length type defined in the user's account settings for
  // walking.
  //
  // Updates to this field are currently not supported.
  StrideLengthType stride_length_walking_type = 13
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The stride length type defined in the user's account settings for
  // running.
  //
  // Updates to this field are currently not supported.
  StrideLengthType stride_length_running_type = 14
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The measurement unit defined in the user's account settings.
  SwimUnit swim_unit = 15 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The measurement unit defined in the user's account settings.
  TemperatureUnit temperature_unit = 16
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The timezone defined in the user's account settings. This follows
  // the IANA [Time Zone Database](https://www.iana.org/time-zones).
  //
  // Updates to this field are currently not supported.
  string time_zone = 17 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The measurement unit defined in the user's account settings.
  WeightUnit weight_unit = 18 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The measurement unit defined in the user's account settings.
  WaterUnit water_unit = 19 [(google.api.field_behavior) = OPTIONAL];

  // Output 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.
  string food_language_code = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Represents details about the Google user's identity.
message Identity {
  option (google.api.resource) = {
    type: "health.googleapis.com/Identity"
    pattern: "users/{user}/identity"
    plural: "identities"
    singular: "identity"
  };

  // Identifier. The resource name of this Identity resource.
  // Format: `users/me/identity`
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Output only. The legacy Fitbit User identifier. This is the Fitbit ID used
  // in the legacy Fitbit APIs (v1-v3). It can be referenced by clients
  // migrating from the legacy Fitbit APIs to map their existing identifiers to
  // the new Google user ID.
  //
  // It **must not** be used for any other purpose. It is not of any use for new
  // clients using only the Google Health APIs.
  //
  // Valid values are strings of 1-63 characters, and valid characters are
  // lowercase and uppercase letters, numbers, and hyphens.
  string legacy_user_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The Google User Identifier in the Google Health APIs. It
  // matches the
  // `{user}` resource ID segment in the resource name paths, e.g.
  // `users/{user}/dataTypes/steps`.
  //
  // Valid values are strings of 1-63 characters, and valid characters are
  // lowercase and uppercase letters, numbers, and hyphens.
  string health_user_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Request message for getting Profile details.
message GetProfileRequest {
  // Required. The name of the Profile.
  // Format: `users/me/profile`.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "health.googleapis.com/Profile" }
  ];
}

// Request message for getting IRN Profile details.
message GetIrnProfileRequest {
  // Required. The resource name of the IRN Profile.
  // Format: `users/{user}/irnProfile`
  // Example: `users/1234567890/irnProfile` or `users/me/irnProfile`
  // 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.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "health.googleapis.com/IrnProfile"
    }
  ];
}

// Request message for updating Profile details.
message UpdateProfileRequest {
  // Required. Profile details.
  Profile profile = 1 [(google.api.field_behavior) = REQUIRED];

  // Optional. The list of fields to be updated.
  google.protobuf.FieldMask update_mask = 2
      [(google.api.field_behavior) = OPTIONAL];
}

// Request message for getting Settings details.
message GetSettingsRequest {
  // Required. The name of the Settings.
  // Format: `users/me/settings`.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "health.googleapis.com/Settings" }
  ];
}

// Request message for updating Settings details.
message UpdateSettingsRequest {
  // Required. Settings details
  Settings settings = 1 [(google.api.field_behavior) = REQUIRED];

  // Optional. The list of fields to be updated.
  google.protobuf.FieldMask update_mask = 2
      [(google.api.field_behavior) = OPTIONAL];
}

// Request message for getting Identity details.
message GetIdentityRequest {
  // Required. The resource name of the Identity.
  // Format: `users/me/identity`
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "health.googleapis.com/Identity" }
  ];
}

// Request message for getting a Device.
message GetPairedDeviceRequest {
  // Required. The name of the device to retrieve.
  // Format: users/{user}/devices/{device}
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "health.googleapis.com/PairedDevice"
    }
  ];
}

// Request message for listing Devices.
message ListPairedDevicesRequest {
  // Required. The parent, which owns this collection of devices.
  // Format: users/{user}
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "health.googleapis.com/PairedDevice"
    }
  ];

  // Optional. The maximum number of devices to return. The service may return
  // fewer than this value. If unspecified, at most 5 devices will be returned.
  // The maximum value is 100. values above 100 will be coerced to 100.
  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. A page token, received from a previous `ListPairedDevices` call.
  // Provide this to retrieve the subsequent page.
  //
  // When paginating, all other parameters provided to `ListPairedDevices` must
  // match the call that provided the page token.
  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for ListPairedDevices.
message ListPairedDevicesResponse {
  // The paired devices of the user.
  repeated PairedDevice paired_devices = 1;

  // A token, which can be sent as `page_token` to retrieve the next page.
  // If this field is omitted, there are no subsequent pages.
  string next_page_token = 2;
}
